Re: Alter or rename enum value
Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
From: ilmari@ilmari.org (Dagfinn Ilmari Mannsåker )
To: pgsql-hackers@postgresql.org
Date: 2016-03-25T19:28:24Z
Lists: pgsql-hackers
Attachments
- 0001-Add-ALTER-TYPE-.-ALTER-VALUE-.-TO-v2.patch (text/x-diff)
Andrew Dunstan <andrew@dunslane.net> writes: > On 03/25/2016 04:13 AM, Matthias Kurz wrote: >> >> Hopefully at the commitfest at least the transaction limitation >> will/could be tackled - that would help us a lot already. > > I don't believe anyone knows how to do that safely. Enums pose special > problems here exactly because unlike all other types the set of valid > values is mutable. However, this problem (and the one described in the comments of AlterEnum()) doesn't apply to altering the name, since that doesn't affect the OID or the ordering. Attached is version 2 of the patch, which allows ALTER TYPE ... ALTER VALUE inside a transaction. It still needs documentation, and possibly support for IF (NOT) EXISTS, if people think that's useful.
Commits
-
Relax transactional restrictions on ALTER TYPE ... ADD VALUE (redux).
- 212fab9926b2 12.0 landed
-
Partially restore comments discussing enum renumbering hazards.
- c9e2e2db5c20 9.4.0 cited
-
Allow adding values to an enum type created in the current transaction.
- 7b90469b7176 9.3.0 cited