Fix pg_dump output of policies.

pg_dump neglected to wrap parenthesis around USING and WITH CHECK
expressions -- fixed. Reported by Noah Misch.
This commit is contained in:
Joe Conway 2015-07-27 20:24:27 -07:00
parent 5d179a28fb
commit 510aad31ea

View 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");