Skip to content

Commit d7acf6c

Browse files
committed
Fix pg_dump support for security labels on columns.
Along the way, correct an erroneous comment.
1 parent 6a208aa commit d7acf6c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/bin/pg_dump/pg_dump.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10730,7 +10730,7 @@ dumpTableSecLabel(Archive *fout, TableInfo *tbinfo, const char *reltypename)
1073010730
tbinfo->dobj.catId.oid,
1073110731
&labels);
1073210732

10733-
/* If comments exist, build SECURITY LABEL statements */
10733+
/* If security labels exist, build SECURITY LABEL statements */
1073410734
if (nlabels <= 0)
1073510735
return;
1073610736

@@ -10753,9 +10753,9 @@ dumpTableSecLabel(Archive *fout, TableInfo *tbinfo, const char *reltypename)
1075310753
else
1075410754
{
1075510755
colname = getAttrName(objsubid, tbinfo);
10756-
appendPQExpBuffer(target, "COLUMN %s.%s",
10757-
fmtId(tbinfo->dobj.name),
10758-
fmtId(colname));
10756+
/* first fmtId result must be consumed before calling it again */
10757+
appendPQExpBuffer(target, "COLUMN %s", fmtId(tbinfo->dobj.name));
10758+
appendPQExpBuffer(target, ".%s", fmtId(colname));
1075910759
}
1076010760
appendPQExpBuffer(query, "SECURITY LABEL FOR %s ON %s IS ",
1076110761
fmtId(provider), target->data);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy