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

Commitd050c61

Browse files
committed
Fix pg_dump/pg_restore to restore event trigger comments later.
Repair an oversight in commit8728b2c: if we're postponing restoreof event triggers to the end, we must also postpone restoring anycomments on them, since of course we cannot create the comments first.(This opens yet another opportunity for an event trigger to bollixthe restore, but there's no help for that.)Per bug #16346 from Alexander Lakhin.Like the previous commit, back-patch to all supported branches.Hamid Akhtar and Tom LaneDiscussion:https://postgr.es/m/16346-6210ad7a0ea81be1@postgresql.org
1 parent5fae664 commitd050c61

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

‎src/bin/pg_dump/pg_backup_archiver.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3092,6 +3092,18 @@ _tocEntryRestorePass(TocEntry *te)
30923092
if (strcmp(te->desc,"EVENT TRIGGER")==0||
30933093
strcmp(te->desc,"MATERIALIZED VIEW DATA")==0)
30943094
returnRESTORE_PASS_POST_ACL;
3095+
3096+
/*
3097+
* Comments need to be emitted in the same pass as their parent objects.
3098+
* ACLs haven't got comments, and neither do matview data objects, but
3099+
* event triggers do. (Fortunately, event triggers haven't got ACLs, or
3100+
* we'd need yet another weird special case.)
3101+
*/
3102+
if (strcmp(te->desc,"COMMENT")==0&&
3103+
strncmp(te->tag,"EVENT TRIGGER ",14)==0)
3104+
returnRESTORE_PASS_POST_ACL;
3105+
3106+
/* All else can be handled in the main pass. */
30953107
returnRESTORE_PASS_MAIN;
30963108
}
30973109

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp