Re: [PATCH] Alter or rename enum value

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: Robert Haas <robertmhaas@gmail.com>, Emre Hasegeli <emre@hasegeli.com>, Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>, Matthias Kurz <m.kurz@irregular.at>, Jim Nasby <Jim.Nasby@bluetreble.com>, "David G. Johnston" <david.g.johnston@gmail.com>
Date: 2016-09-06T20:19:30Z
Lists: pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> Are we also going to have an exists test for the original thing being 
> renamed? Exists tests on renames do strike me as somewhat cumbersome, to 
> say the least.

I'm less opposed to that part, because it's at least got *some* precedent
in existing RENAME features.  But the fact that RENAME COLUMN hasn't got
it still makes me wonder why this is the first place that's getting it
("it" being an EXISTS test that applies to a sub-object rather than the
whole object being ALTER'd).

Bottom line here is that I'd rather commit ALTER TYPE RENAME VALUE with
no EXISTS features and then see it accrete those features together with
other types of RENAME, when and if there's a will to make that happen.

			regards, tom lane


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.