Re: Alter or rename enum value

From: Emre Hasegeli <emre(at)hasegeli(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Christophe Pettus <xof(at)thebuild(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Matthias Kurz <m(dot)kurz(at)irregular(dot)at>, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Alter or rename enum value
Date: 2016-03-28 09:42:54
Message-ID: CAE2gYzx51+eJ4R+ct371ogjVBCR8aUbr4oS7LYpQaRPaTxkK8w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> I do not know whether this would be a meaningful improvement for
> common use-cases, though. (It'd help if people were more specific
> about the use-cases they need to work.)

For what its worth, in the company I am working for, InnoGames GmbH,
not being able to alter enums is the number one pain point with
PostgreSQL. We have hundreds of small databases on the backend of the
game worlds. They are heavily using enums. New values to the enums
need to be added or to be removed for the new features. We are
relying on the transactions for the database migrations, so we
couldn't make use of ALTER TYPE ADD VALUE.

Some functions found on the Internet [1] which change the values on
the catalog had been used, until they corrupted some indexes. (I
believe those functions are still quite common.) Now, we are using a
function to replace an enum type on all tables with another one, but
we are not at all happy with this solution. It requires all objects
which were using the enum to be dropped and recreated, and it rewrites
the tables, so it greatly increases the migration time and effort.

[1] http://en.dklab.ru/lib/dklab_postgresql_enum/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2016-03-28 10:09:06 Re: Postgres_fdw join pushdown - INNER - FULL OUTER join combination generating wrong result
Previous Message Masahiko Sawada 2016-03-28 09:38:22 Re: Support for N synchronous standby servers - take 2