diff options
author | Robert Haas <rhaas@postgresql.org> | 2011-01-01 17:43:37 -0500 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2011-01-01 17:44:28 -0500 |
commit | d7acf6cc4a1ae53fcd5b4a8a702c43a267f33ba3 (patch) | |
tree | 07f4a6e9bd64e3e87f7db145ce08f18c9b315a87 /src | |
parent | 6a208aa40438652e2f3129a63af5d08ae53d9398 (diff) | |
download | postgresql-d7acf6cc4a1ae53fcd5b4a8a702c43a267f33ba3.tar.gz postgresql-d7acf6cc4a1ae53fcd5b4a8a702c43a267f33ba3.zip |
Fix pg_dump support for security labels on columns.
Along the way, correct an erroneous comment.
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/pg_dump/pg_dump.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index b35a5457f94..08288e871a9 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -10730,7 +10730,7 @@ dumpTableSecLabel(Archive *fout, TableInfo *tbinfo, const char *reltypename) tbinfo->dobj.catId.oid, &labels); - /* If comments exist, build SECURITY LABEL statements */ + /* If security labels exist, build SECURITY LABEL statements */ if (nlabels <= 0) return; @@ -10753,9 +10753,9 @@ dumpTableSecLabel(Archive *fout, TableInfo *tbinfo, const char *reltypename) else { colname = getAttrName(objsubid, tbinfo); - appendPQExpBuffer(target, "COLUMN %s.%s", - fmtId(tbinfo->dobj.name), - fmtId(colname)); + /* first fmtId result must be consumed before calling it again */ + appendPQExpBuffer(target, "COLUMN %s", fmtId(tbinfo->dobj.name)); + appendPQExpBuffer(target, ".%s", fmtId(colname)); } appendPQExpBuffer(query, "SECURITY LABEL FOR %s ON %s IS ", fmtId(provider), target->data); |