]> granicus.if.org Git - postgresql/commitdiff
Fix pg_dump output of policies.
authorJoe Conway <mail@joeconway.com>
Tue, 28 Jul 2015 03:24:27 +0000 (20:24 -0700)
committerJoe Conway <mail@joeconway.com>
Tue, 28 Jul 2015 03:24:27 +0000 (20:24 -0700)
pg_dump neglected to wrap parenthesis around USING and WITH CHECK
expressions -- fixed. Reported by Noah Misch.

src/bin/pg_dump/pg_dump.c

index 0b5262a8a1a7d0919cfdbecd09751abff438d351..ba1497fed49d7b29b2e192835f35b3540586af42 100644 (file)
@@ -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");