Re: Alter or rename enum value

Christophe Pettus <xof@thebuild.com>

From: Christophe Pettus <xof@thebuild.com>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: Matthias Kurz <m.kurz@irregular.at>, Tom Lane <tgl@sss.pgh.pa.us>, Jim Nasby <Jim.Nasby@bluetreble.com>, pgsql-hackers@postgresql.org
Date: 2016-03-25T19:22:59Z
Lists: pgsql-hackers
On Mar 25, 2016, at 11:50 AM, Andrew Dunstan <andrew@dunslane.net> wrote:

> I don't believe anyone knows how to do that safely.

The core issue, for me, is that not being able to modify enum values in a transaction breaks a very wide variety of database migration tools.  Even a very brutal solution like marking indexes containing the altered type invalid on a ROLLBACK would be preferable to the current situation.

--
-- Christophe Pettus
   xof@thebuild.com



Commits

  1. Relax transactional restrictions on ALTER TYPE ... ADD VALUE (redux).

  2. Partially restore comments discussing enum renumbering hazards.

  3. Allow adding values to an enum type created in the current transaction.