Re: Transactional enum additions - was Re: Alter or rename enum value
Andrew Dunstan <andrew@dunslane.net>
From: Andrew Dunstan <andrew@dunslane.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Christophe Pettus <xof@thebuild.com>,
"David G. Johnston" <david.g.johnston@gmail.com>,
Matthias Kurz <m.kurz@irregular.at>, Jim Nasby <Jim.Nasby@bluetreble.com>,
"pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2016-04-24T18:44:22Z
Lists: pgsql-hackers
Attachments
- transactional_enum-additions-v1x.patch (binary/octet-stream) patch
On 04/02/2016 01:20 PM, Tom Lane wrote: > Andrew Dunstan <andrew@dunslane.net> writes: >> Looking at this briefly. It looks like the check should be called from >> enum_in() and enum_recv(). What error should be raised if the enum row's >> xmin isn't committed? ERRCODE_FEATURE_NOT_SUPPORTED? or maybe >> ERRCODE_DATA_EXCEPTION? I don't see anything that fits very well. > ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE is something we use in some > other places where the meaning is "just wait awhile, dude". Or you > could invent a new ERRCODE. > > OK, did that. Here is a patch that is undocumented but I think is otherwise complete. It's been tested a bit and we haven't been able to break it. Comments welcome. cheers andrew
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