Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite2ff7d9

Browse files
committed
Make pg_dump acquire lock on partitioned tables that are to be dumped.
It was clearly the intent to do so all along, but the original codingfat-fingered this by checking the wrong array element. We fixed itin passing in403a3d9, but that later got reverted, and we forgotto keep this bug fix.Most of the time this'd be relatively harmless, since once we lockany of the partitioned table's leaf partitions, that would sufficeto prevent major DDL on the partitioned table itself. However, achildless partitioned table would get dumped with no relevant lockwhatsoever, possibly allowing dump failure or inconsistent output.Unlike403a3d9, there are no versioning concerns, since every serverversion that has partitioned tables will allow you to lock one.Back-patch to v10 where partitioned tables were introduced.Discussion:https://postgr.es/m/1018205.1634346327@sss.pgh.pa.us
1 parentb76c1d6 commite2ff7d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/bin/pg_dump/pg_dump.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7016,7 +7016,7 @@ getTables(Archive *fout, int *numTables)
70167016
*/
70177017
if (tblinfo[i].dobj.dump &&
70187018
(tblinfo[i].relkind == RELKIND_RELATION ||
7019-
tblinfo->relkind == RELKIND_PARTITIONED_TABLE) &&
7019+
tblinfo[i].relkind == RELKIND_PARTITIONED_TABLE) &&
70207020
(tblinfo[i].dobj.dump & DUMP_COMPONENTS_REQUIRING_LOCK))
70217021
{
70227022
resetPQExpBuffer(query);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp