From: Stephen Frost Date: Thu, 29 Jan 2015 03:16:24 +0000 (-0500) Subject: Improve CREATE POLICY documentation X-Git-Tag: REL9_5_ALPHA1~857 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=42f66b27566798d9969791ec6d2acd399c41b60f;p=postgresql.git Improve CREATE POLICY documentation The CREATE POLICY documention didn't sufficiently clarify what happens when a given command type (eg: ALL or UPDATE) accepts both USING and WITH CHECK clauses, but only the USING clause is defined. Add language to clarify that, in such a case, the USING clause will be used for both USING and WITH CHECK cases. Pointed out by Peter Geoghegan. --- diff --git a/doc/src/sgml/ref/create_policy.sgml b/doc/src/sgml/ref/create_policy.sgml index 8ef8556b518..18ab4a78f92 100644 --- a/doc/src/sgml/ref/create_policy.sgml +++ b/doc/src/sgml/ref/create_policy.sgml @@ -63,7 +63,11 @@ CREATE POLICY name ON @@ -204,8 +208,10 @@ CREATE POLICY name ON ALL WITH CHECK - (or USING, if no WITH CHECK expression is defined) expression, the - command will error. + expression, the entire command will be aborted. Note that if only a + USING clause is specified then that clause will be + used for both USING and + WITH CHECK cases. @@ -256,7 +262,10 @@ CREATE POLICY name ON INSERT policy). Any rows whose resulting values do not pass the WITH CHECK expression will cause an ERROR and the - entire command will be aborted. + entire command will be aborted. Note that if only a + USING clause is specified then that clause will be + used for both USING and + WITH CHECK cases.