Re: [PATCH] Alter or rename enum value
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: emre@hasegeli.com
Cc: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>, Andrew Dunstan <andrew@dunslane.net>, Matthias Kurz <m.kurz@irregular.at>, Jim Nasby <Jim.Nasby@bluetreble.com>, "David G. Johnston" <david.g.johnston@gmail.com>
Date: 2016-08-21T14:28:18Z
Lists: pgsql-hackers
Emre Hasegeli <emre@hasegeli.com> writes: >> + ReleaseCatCacheList(list); >> + heap_close(pg_enum, RowExclusiveLock); > Maybe we better release them before reporting error, too. I would > release the list after the loop, close the heap before ereport(). Transaction abort will clean up such resources just fine; if it did not, then any function you call would have problems if it threw an error. I would not contort the logic to free stuff before ereport. regards, tom lane
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