From: Joe Conway Date: Tue, 28 Jul 2015 03:24:27 +0000 (-0700) Subject: Fix pg_dump output of policies. X-Git-Tag: REL9_5_ALPHA2~50 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=510aad31eaf2129d28ae3dbfc58f98775192ee94;p=postgresql Fix pg_dump output of policies. pg_dump neglected to wrap parenthesis around USING and WITH CHECK expressions -- fixed. Reported by Noah Misch. --- diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 0b5262a8a1..ba1497fed4 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -3012,10 +3012,10 @@ dumpPolicy(Archive *fout, DumpOptions *dopt, PolicyInfo *polinfo) appendPQExpBuffer(query, " TO %s", polinfo->polroles); if (polinfo->polqual != NULL) - appendPQExpBuffer(query, " USING %s", polinfo->polqual); + appendPQExpBuffer(query, " USING (%s)", polinfo->polqual); if (polinfo->polwithcheck != NULL) - appendPQExpBuffer(query, " WITH CHECK %s", polinfo->polwithcheck); + appendPQExpBuffer(query, " WITH CHECK (%s)", polinfo->polwithcheck); appendPQExpBuffer(query, ";\n");