pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix potential catalog corruption with temporary identity columns 3+ messages / 1 participants [nested] [flat]
* pgsql: Fix potential catalog corruption with temporary identity columns @ 2019-04-29 06:55 Peter Eisentraut <peter@eisentraut.org> 0 siblings, 0 replies; 3+ messages in thread From: Peter Eisentraut @ 2019-04-29 06:55 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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> Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/10b2675d6e79ad76f2b74c569f4cf1a716a904c1 Modified Files -------------- src/backend/tcop/utility.c | 7 +++++++ 1 file changed, 7 insertions(+) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Fix potential catalog corruption with temporary identity columns @ 2019-04-29 06:55 Peter Eisentraut <peter@eisentraut.org> 0 siblings, 0 replies; 3+ messages in thread From: Peter Eisentraut @ 2019-04-29 06:55 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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> Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/cd3e27464cca40664c54fb8cd10454f979c1db4e Modified Files -------------- src/backend/tcop/utility.c | 7 +++++++ 1 file changed, 7 insertions(+) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Fix potential catalog corruption with temporary identity columns @ 2019-04-29 06:55 Peter Eisentraut <peter@eisentraut.org> 0 siblings, 0 replies; 3+ messages in thread From: Peter Eisentraut @ 2019-04-29 06:55 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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> Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/474982fc398dc848da2d08a911e2900b9575217f Modified Files -------------- src/backend/tcop/utility.c | 7 +++++++ 1 file changed, 7 insertions(+) ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2019-04-29 06:55 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2019-04-29 06:55 pgsql: Fix potential catalog corruption with temporary identity columns Peter Eisentraut <peter@eisentraut.org> 2019-04-29 06:55 pgsql: Fix potential catalog corruption with temporary identity columns Peter Eisentraut <peter@eisentraut.org> 2019-04-29 06:55 pgsql: Fix potential catalog corruption with temporary identity columns Peter Eisentraut <peter@eisentraut.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox