postgresql/src/backend/tcop
Peter Eisentraut cd3e27464c Fix potential catalog corruption with temporary identity columns
If a temporary table with an identity column and ON COMMIT DROP is
created in a single-statement transaction (not useful, but allowed),
it would leave the catalog corrupted.  We need to add a
CommandCounterIncrement() so that PreCommit_on_commit_actions() sees
the created dependency between table and sequence and can clean it
up.

The analogous and more useful case of doing this in a transaction
block already runs some CommandCounterIncrement() before it gets to
the on-commit cleanup, so it wasn't a problem in practical use.

Several locations for placing the new CommandCounterIncrement() call
were discussed.  This patch places it at the end of
standard_ProcessUtility().  That would also help if other commands
were to create catalog entries that some on-commit action would like
to see.

Bug: #15631
Reported-by: Serge Latyntsev <dnsl48@gmail.com>
Author: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
2019-04-29 08:49:03 +02:00
..
Makefile Define WIN32_STACK_RLIMIT throughout win32 and cygwin builds. 2019-04-09 08:25:39 -07:00
dest.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
fastpath.c Change function call information to be variable length. 2019-01-26 14:17:52 -08:00
postgres.c Log all statements from a sample of transactions 2019-04-03 18:43:59 -03:00
pquery.c Update copyright for 2019 2019-01-02 12:44:25 -05:00
utility.c Fix potential catalog corruption with temporary identity columns 2019-04-29 08:49:03 +02:00