Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c3cc844

Browse files
committed
Fix psql \d output of policies.
psql neglected to wrap parenthesis around USING and WITH CHECK expressions -- fixed. Back-patched to 9.5 where RLS policies were introduced.
1 parent dd85acf commit c3cc844

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/bin/psql/describe.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -2083,11 +2083,11 @@ describeOneTableDetails(const char *schemaname,
20832083
}
20842084

20852085
if (!PQgetisnull(result, i, 2))
2086-
appendPQExpBuffer(&buf, "\n USING %s",
2086+
appendPQExpBuffer(&buf, "\n USING (%s)",
20872087
PQgetvalue(result, i, 2));
20882088

20892089
if (!PQgetisnull(result, i, 3))
2090-
appendPQExpBuffer(&buf, "\n WITH CHECK %s",
2090+
appendPQExpBuffer(&buf, "\n WITH CHECK (%s)",
20912091
PQgetvalue(result, i, 3));
20922092

20932093
printTableAddFooter(&cont, buf.data);

0 commit comments

Comments
 (0)