Skip to content

Commit 9f15188

Browse files
committed
pg_dump: label INDEX ATTACH ArchiveEntries with an owner.
Although a partitioned index's attachment to its parent doesn't have separate ownership, the ArchiveEntry for it needs to be marked with an owner anyway, to ensure that the ALTER command is run by the appropriate role when restoring with --use-set-session-authorization. Without this, the ALTER will be run by the role that started the restore session, which will usually work but it's formally the wrong thing. Back-patch to v11 where this type of ArchiveEntry was added. In HEAD, add equivalent commentary to the just-added TABLE ATTACH case, which I'd made do the right thing already. Discussion: https://postgr.es/m/1094034.1610418498@sss.pgh.pa.us
1 parent 57404fe commit 9f15188

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
@@ -16532,7 +16532,7 @@ dumpIndexAttach(Archive *fout, IndexAttachInfo *attachinfo)
1653216532
attachinfo->dobj.name,
1653316533
attachinfo->dobj.namespace->dobj.name,
1653416534
NULL,
16535-
"",
16535+
attachinfo->parentIdx->indextable->rolname,
1653616536
false, "INDEX ATTACH", SECTION_POST_DATA,
1653716537
q->data, "", NULL,
1653816538
NULL, 0,

0 commit comments

Comments
 (0)