Of course, better thoughts appear immediately after hitting the send button.

This version of the table attempts to stipulate which section of the
process the rule applies to.

On Thu, May 11, 2017 at 8:40 PM, Rod Taylor <rod.tay...@gmail.com> wrote:

> I think the biggest piece missing is something to summarize the giant
> blocks of text.
>
> Attached is a table that has commands and policy types, and a "yes" if it
> applies.
>
> --
> Rod Taylor
>



-- 
Rod Taylor
diff --git a/doc/src/sgml/ref/create_policy.sgml b/doc/src/sgml/ref/create_policy.sgml
index 3b24e5e95e..4c997a956d 100644
--- a/doc/src/sgml/ref/create_policy.sgml
+++ b/doc/src/sgml/ref/create_policy.sgml
@@ -389,6 +389,72 @@ CREATE POLICY <replaceable class="parameter">name</replaceable> ON <replaceable
      </varlistentry>
 
    </variablelist>
+
+   <table><title>Policies Applied During Statement</title>
+    <tgroup cols='5'>
+     <thead>
+      <row>
+       <entry>Policy</entry>
+       <entry><literal>SELECT</literal></entry>
+       <entry><literal>INSERT</literal></entry>
+       <entry><literal>UPDATE</literal></entry>
+       <entry><literal>DELETE</literal></entry>
+      </row>
+     </thead>
+     <tbody>
+      <row>
+       <entry><literal>FOR ALL ... USING</literal></entry>
+       <entry><literal>WHERE</literal> clause</entry>
+       <entry><literal>RETURNING</literal> clause</entry>
+       <entry><literal>WHERE</literal> and <literal>RETURNING</literal> clause</entry>
+       <entry><literal>WHERE</literal> and <literal>RETURNING</literal> clause</entry>
+      </row>
+      <row>
+       <entry><literal>FOR ALL ... WITH CHECK</literal></entry>
+       <entry></entry>
+       <entry>new tuple</entry>
+       <entry>new tuple</entry>
+       <entry>new tuple</entry>
+      </row>
+      <row>
+       <entry><literal>FOR SELECT ... USING</literal></entry>
+       <entry><literal>WHERE</literal> clause</entry>
+       <entry><literal>RETURNING</literal> clause</entry>
+       <entry><literal>WHERE</literal> and <literal>RETURNING</literal> clause</entry>
+       <entry><literal>WHERE</literal> and <literal>RETURNING</literal> clause</entry>
+      </row>
+      <row>
+       <entry><literal>FOR INSERT ... WITH CHECK</literal></entry>
+       <entry></entry>
+       <entry>new tuple</entry>
+       <entry></entry>
+       <entry></entry>
+      </row>
+      <row>
+       <entry><literal>FOR UPDATE ... USING</literal></entry>
+       <entry></entry>
+       <entry></entry>
+       <entry><literal>WHERE</literal> clause</entry>
+       <entry></entry>
+      </row>
+      <row>
+       <entry><literal>FOR UPDATE ... WITH CHECK</literal></entry>
+       <entry></entry>
+       <entry></entry>
+       <entry>new tuple</entry>
+       <entry></entry>
+      </row>
+      <row>
+       <entry><literal>FOR DELETE ... USING</literal></entry>
+       <entry></entry>
+       <entry></entry>
+       <entry></entry>
+       <entry><literal>WHERE</literal> clause</entry>
+      </row>
+     </tbody>
+    </tgroup>
+   </table>
+
   </refsect2>
  </refsect1>
 
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to