postgresql/src/include
Tom Lane 1635e80d30 Use a blacklist to distinguish original from add-on enum values.
Commit 15bc038f9 allowed ALTER TYPE ADD VALUE to be executed inside
transaction blocks, by disallowing the use of the added value later
in the same transaction, except under limited circumstances.  However,
the test for "limited circumstances" was heuristic and could reject
references to enum values that were created during CREATE TYPE AS ENUM,
not just later.  This breaks the use-case of restoring pg_dump scripts
in a single transaction, as reported in bug #14825 from Balazs Szilfai.

We can improve this by keeping a "blacklist" table of enum value OIDs
created by ALTER TYPE ADD VALUE during the current transaction.  Any
visible-but-uncommitted value whose OID is not in the blacklist must
have been created by CREATE TYPE AS ENUM, and can be used safely
because it could not have a lifespan shorter than its parent enum type.

This change also removes the restriction that a renamed enum value
can't be used before being committed (unless it was on the blacklist).

Andrew Dunstan, with cosmetic improvements by me.
Back-patch to v10.

Discussion: https://postgr.es/m/20170922185904.1448.16585@wrigleys.postgresql.org
2017-09-26 13:14:46 -04:00
..
access Remove lsn from HashScanPosData. 2017-09-26 09:16:45 -04:00
bootstrap Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
catalog Use a blacklist to distinguish original from add-on enum values. 2017-09-26 13:14:46 -04:00
commands Make ExplainOpenGroup and ExplainCloseGroup public. 2017-09-18 16:01:16 -04:00
common Increase SCRAM salt length 2017-08-24 14:04:28 -04:00
datatype Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
executor Remove TupleDesc remapping logic from tqueue.c. 2017-09-14 19:59:29 -07:00
fe_utils Provide a test for variable existence in psql 2017-09-21 19:02:23 -04:00
foreign Separate reinitialization of shared parallel-scan state from ExecReScan. 2017-08-30 13:18:16 -04:00
lib Remove pre-order and post-order traversal logic for red-black trees. 2017-09-10 13:19:11 -04:00
libpq Allow custom search filters to be configured for LDAP auth 2017-09-12 09:49:04 -04:00
mb Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
nodes Associate partitioning information with each RelOptInfo. 2017-09-20 23:39:13 -04:00
optimizer Assorted preparatory refactoring for partition-wise join. 2017-08-15 12:30:38 -04:00
parser Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
port Further marginal hacking on generic atomic ops. 2017-09-07 08:50:01 -04:00
portability Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
postmaster Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
regex Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
replication Update code comment for temporary replication slots 2017-08-23 14:59:25 -04:00
rewrite Teach map_partition_varattnos to handle whole-row expressions. 2017-08-03 11:21:29 -04:00
snowball Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
statistics Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
storage Refactor new file permission handling 2017-09-23 10:16:18 -04:00
tcop Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
tsearch Assume wcstombs(), towlower(), and sibling functions are always present. 2017-09-22 11:00:58 -04:00
utils Add inline murmurhash32(uint32) function. 2017-09-22 13:38:42 -07:00
.gitignore Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
c.h Assume wcstombs(), towlower(), and sibling functions are always present. 2017-09-22 11:00:58 -04:00
fmgr.h Introduce 64-bit hash functions with a 64-bit seed. 2017-08-31 22:21:21 -04:00
funcapi.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
getaddrinfo.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
getopt_long.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
Makefile Add statistics subdirectory to Makefile. 2017-06-08 11:29:50 -04:00
miscadmin.h Change pg_ctl to detect server-ready by watching status in postmaster.pid. 2017-06-28 17:31:32 -04:00
pg_config.h.in Avoid SIGBUS on Linux when a DSM memory request overruns tmpfs. 2017-09-25 16:09:19 -04:00
pg_config.h.win32 Avoid SIGBUS on Linux when a DSM memory request overruns tmpfs. 2017-09-25 16:09:19 -04:00
pg_config_ext.h.in Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_ext.h.win32 Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_manual.h Fix s/intidb/initdb/ typo. 2017-09-22 11:35:26 -07:00
pg_getopt.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
pg_trace.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
pgstat.h Avoid use of non-portable strnlen() in pgstat_clip_activity(). 2017-09-19 14:25:47 -07:00
pgtar.h Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
pgtime.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
port.h Change pg_ctl to detect server-ready by watching status in postmaster.pid. 2017-06-28 17:31:32 -04:00
postgres.h Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
postgres_ext.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
postgres_fe.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
rusagestub.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
windowapi.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00