Commit c1611db0 authored by Tom Lane's avatar Tom Lane

Do some copy-editing on the docs for row-level security.

Clarifications, markup improvements, corrections of misleading or
outright wrong statements.
parent 939d10cd
This diff is collapsed.
...@@ -16,13 +16,14 @@ PostgreSQL documentation ...@@ -16,13 +16,14 @@ PostgreSQL documentation
<refnamediv> <refnamediv>
<refname>ALTER POLICY</refname> <refname>ALTER POLICY</refname>
<refpurpose>change the definition of a policy</refpurpose> <refpurpose>change the definition of a row level security policy</refpurpose>
</refnamediv> </refnamediv>
<refsynopsisdiv> <refsynopsisdiv>
<synopsis> <synopsis>
ALTER POLICY <replaceable class="parameter">name</replaceable> ON <replaceable class="parameter">table_name</replaceable> RENAME TO <replaceable class="PARAMETER">new_name</replaceable>
ALTER POLICY <replaceable class="parameter">name</replaceable> ON <replaceable class="parameter">table_name</replaceable> ALTER POLICY <replaceable class="parameter">name</replaceable> ON <replaceable class="parameter">table_name</replaceable>
[ RENAME TO <replaceable class="PARAMETER">new_name</replaceable> ]
[ TO { <replaceable class="parameter">role_name</replaceable> | PUBLIC | CURRENT_USER | SESSION_USER } [, ...] ] [ TO { <replaceable class="parameter">role_name</replaceable> | PUBLIC | CURRENT_USER | SESSION_USER } [, ...] ]
[ USING ( <replaceable class="parameter">using_expression</replaceable> ) ] [ USING ( <replaceable class="parameter">using_expression</replaceable> ) ]
[ WITH CHECK ( <replaceable class="parameter">check_expression</replaceable> ) ] [ WITH CHECK ( <replaceable class="parameter">check_expression</replaceable> ) ]
...@@ -33,14 +34,22 @@ ALTER POLICY <replaceable class="parameter">name</replaceable> ON <replaceable c ...@@ -33,14 +34,22 @@ ALTER POLICY <replaceable class="parameter">name</replaceable> ON <replaceable c
<title>Description</title> <title>Description</title>
<para> <para>
<command>ALTER POLICY</command> changes the <replaceable class="parameter"> <command>ALTER POLICY</command> changes the definition of an existing
definition</replaceable> of an existing policy. row-level security policy.
</para> </para>
<para> <para>
To use <command>ALTER POLICY</command>, you must own the table that To use <command>ALTER POLICY</command>, you must own the table that
the policy applies to. the policy applies to.
</para> </para>
<para>
In the second form of <command>ALTER POLICY</command>, the role list,
<replaceable class="parameter">using_expression</replaceable>, and
<replaceable class="parameter">check_expression</replaceable> are replaced
independently if specified. When one of those clauses is omitted, the
corresponding part of the policy is unchanged.
</para>
</refsect1> </refsect1>
<refsect1> <refsect1>
...@@ -79,9 +88,9 @@ ALTER POLICY <replaceable class="parameter">name</replaceable> ON <replaceable c ...@@ -79,9 +88,9 @@ ALTER POLICY <replaceable class="parameter">name</replaceable> ON <replaceable c
<term><replaceable class="parameter">role_name</replaceable></term> <term><replaceable class="parameter">role_name</replaceable></term>
<listitem> <listitem>
<para> <para>
The role to which the policy applies. Multiple roles can be specified at one time. The role(s) to which the policy applies. Multiple roles can be
To apply the policy to all roles, use <literal>PUBLIC</literal>, which is also specified at one time. To apply the policy to all roles,
the default. use <literal>PUBLIC</literal>.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
......
This diff is collapsed.
...@@ -16,7 +16,7 @@ PostgreSQL documentation ...@@ -16,7 +16,7 @@ PostgreSQL documentation
<refnamediv> <refnamediv>
<refname>DROP POLICY</refname> <refname>DROP POLICY</refname>
<refpurpose>remove a policy from a table</refpurpose> <refpurpose>remove a row level security policy from a table</refpurpose>
</refnamediv> </refnamediv>
<refsynopsisdiv> <refsynopsisdiv>
...@@ -32,10 +32,9 @@ DROP POLICY [ IF EXISTS ] <replaceable class="parameter">name</replaceable> ON < ...@@ -32,10 +32,9 @@ DROP POLICY [ IF EXISTS ] <replaceable class="parameter">name</replaceable> ON <
<command>DROP POLICY</command> removes the specified policy from the table. <command>DROP POLICY</command> removes the specified policy from the table.
Note that if the last policy is removed for a table and the table still has Note that if the last policy is removed for a table and the table still has
row level security enabled via <command>ALTER TABLE</command>, then the row level security enabled via <command>ALTER TABLE</command>, then the
default-deny policy will be used. <command>ALTER TABLE</command> can be used default-deny policy will be used. <literal>ALTER TABLE ... DISABLE ROW
to disable row level security for a table using LEVEL SECURITY</literal> can be used to disable row level security for a
<literal>DISABLE ROW SECURITY</literal>, whether policies for the table table, whether policies for the table exist or not.
exist or not.
</para> </para>
</refsect1> </refsect1>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment