On Thu, Jul 13, 2017 at 5:49 AM, Fabien COELHO <coe...@cri.ensmp.fr> wrote:

>
> Hello Rod,
>
> This version of the table attempts to stipulate which section of the
>> process the rule applies to.
>>
>
> The table should be referenced from the description, something like "Table
> xxx summarizes the ..."
>

Added the below which seemed consistent with other "see something else"
messages.

A summary of the application of policies to a command is found in <xref
linkend="SQL-CREATEPOLICY-SUMMARY">.



> ISTM that it would be clearer to split the Policy column into "FOR xxx
> ..." and "USING" or "WITH CHECK", and to merge the rows which have the same
> "FOR xxx ..." contents, something like:
>
>                POLICY         |
>   ---------------+------------+-----
>                  | USING      | ...
>   FOR ALL ...    +------------+-----
>                  | WITH CHECK | ...
>   ---------------+------------+-----
>   FOR SELECT ... | USING      | ...
>
> So that it is clear that only ALL & UPDATE can get both USING & WITH
> CHECK. This can be done with "morerows=1" on an entry so that it spans more
> rows.
>

Done. I couldn't figure out a morecols=1 equivalent to keep everything
under the Policy heading without a full colspec.



> For empty cells, maybe a dash would be clearer. Not sure.


Looked cluttered to me. Tried N/A first which was even worse.

-- 
Rod Taylor
diff --git a/doc/src/sgml/ref/create_policy.sgml b/doc/src/sgml/ref/create_policy.sgml
index c0dfe1ea4b..52a868e65d 100644
--- a/doc/src/sgml/ref/create_policy.sgml
+++ b/doc/src/sgml/ref/create_policy.sgml
@@ -94,6 +94,11 @@ CREATE POLICY <replaceable class="parameter">name</replaceable> ON <replaceable
    exist, a <quote>default deny</> policy is assumed, so that no rows will
    be visible or updatable.
   </para>
+
+  <para>
+   A summary of the application of policies to a command is found
+   in <xref linkend="SQL-CREATEPOLICY-SUMMARY">.
+  </para>
  </refsect1>
 
  <refsect1>
@@ -389,6 +394,80 @@ CREATE POLICY <replaceable class="parameter">name</replaceable> ON <replaceable
      </varlistentry>
 
    </variablelist>
+
+   <table id="SQL-CREATEPOLICY-SUMMARY"><title>Policies Applied During Statement</title>
+    <tgroup cols='6'>
+     <colspec colname="pol1">
+     <colspec colname="pol2">
+     <colspec colname="select">
+     <colspec colname="insert">
+     <colspec colname="update">
+     <colspec colname="delete">
+     <thead>
+      <row>
+       <entry namest="pol1" nameend="pol2">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 morerows="1"><literal>FOR ALL ...</literal></entry>
+       <entry><literal>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>WITH CHECK</literal></entry>
+       <entry></entry>
+       <entry>new tuple</entry>
+       <entry>new tuple</entry>
+       <entry>new tuple</entry>
+      </row>
+      <row>
+       <entry namest="pol1" nameend="pol2"><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 namest="pol1" nameend="pol2"><literal>FOR INSERT ... WITH CHECK</literal></entry>
+       <entry></entry>
+       <entry>new tuple</entry>
+       <entry></entry>
+       <entry></entry>
+      </row>
+      <row>
+       <entry morerows="1"><literal>FOR UPDATE ...</literal></entry>
+       <entry><literal>USING</literal></entry>
+       <entry></entry>
+       <entry></entry>
+       <entry><literal>WHERE</literal> clause</entry>
+       <entry></entry>
+      </row>
+      <row>
+       <entry><literal>WITH CHECK</literal></entry>
+       <entry></entry>
+       <entry></entry>
+       <entry>new tuple</entry>
+       <entry></entry>
+      </row>
+      <row>
+       <entry namest="pol1" nameend="pol2"><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