Content-Length: 266296 | pFad | http://github.com/postgrespro/postgres/commit/cd3e27464cca40664c54fb8cd10454f979c1db4e

90 Fix potential catalog corruption with temporary identity columns · postgrespro/postgres@cd3e274 · GitHub
Skip to content

Commit cd3e274

Browse files
committed
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>
1 parent c3f67ed commit cd3e274

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/backend/tcop/utility.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -931,6 +931,13 @@ standard_ProcessUtility(PlannedStmt *pstmt,
931931
}
932932

933933
free_parsestate(pstate);
934+
935+
/*
936+
* Make effects of commands visible, for instance so that
937+
* PreCommit_on_commit_actions() can see them (see for example bug
938+
* #15631).
939+
*/
940+
CommandCounterIncrement();
934941
}
935942

936943
/*

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/cd3e27464cca40664c54fb8cd10454f979c1db4e

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy