Debian Codegraph @

doc/src/sgml/ref/drop_policy.sgml

raw
1 <!--
2 doc/src/sgml/ref/drop_policy.sgml
3 PostgreSQL documentation
4 -->
5
6 <refentry id="sql-droppolicy">
7 <indexterm zone="sql-droppolicy">
8 <primary>DROP POLICY</primary>
9 </indexterm>
10
11 <refmeta>
12 <refentrytitle>DROP POLICY</refentrytitle>
13 <manvolnum>7</manvolnum>
14 <refmiscinfo>SQL - Language Statements</refmiscinfo>
15 </refmeta>
16
17 <refnamediv>
18 <refname>DROP POLICY</refname>
19 <refpurpose>remove a row-level security policy from a table</refpurpose>
20 </refnamediv>
21
22 <refsynopsisdiv>
23 <synopsis>
24 DROP POLICY [ IF EXISTS ] <replaceable class="parameter">name</replaceable> ON <replaceable class="parameter">table_name</replaceable> [ CASCADE | RESTRICT ]
25 </synopsis>
26 </refsynopsisdiv>
27
28 <refsect1>
29 <title>Description</title>
30
31 <para>
32 <command>DROP POLICY</command> removes the specified policy from the table.
33 Note that if the last policy is removed for a table and the table still has
34 row-level security enabled via <command>ALTER TABLE</command>, then the
35 default-deny policy will be used. <literal>ALTER TABLE ... DISABLE ROW
36 LEVEL SECURITY</literal> can be used to disable row-level security for a
37 table, whether policies for the table exist or not.
38 </para>
39 </refsect1>
40
41 <refsect1>
42 <title>Parameters</title>
43
44 <variablelist>
45
46 <varlistentry>
47 <term><literal>IF EXISTS</literal></term>
48 <listitem>
49 <para>
50 Do not throw an error if the policy does not exist. A notice is issued
51 in this case.
52 </para>
53 </listitem>
54 </varlistentry>
55
56 <varlistentry>
57 <term><replaceable class="parameter">name</replaceable></term>
58 <listitem>
59 <para>
60 The name of the policy to drop.
61 </para>
62 </listitem>
63 </varlistentry>
64
65 <varlistentry>
66 <term><replaceable class="parameter">table_name</replaceable></term>
67 <listitem>
68 <para>
69 The name (optionally schema-qualified) of the table that
70 the policy is on.
71 </para>
72 </listitem>
73 </varlistentry>
74
75 <varlistentry>
76 <term><literal>CASCADE</literal></term>
77 <term><literal>RESTRICT</literal></term>
78
79 <listitem>
80 <para>
81 These key words do not have any effect, since there are no
82 dependencies on policies.
83 </para>
84 </listitem>
85 </varlistentry>
86
87 </variablelist>
88 </refsect1>
89
90 <refsect1>
91 <title>Examples</title>
92
93 <para>
94 To drop the policy called <literal>p1</literal> on the table named
95 <literal>my_table</literal>:
96
97 <programlisting>
98 DROP POLICY p1 ON my_table;
99 </programlisting></para>
100 </refsect1>
101
102 <refsect1>
103 <title>Compatibility</title>
104
105 <para>
106 <command>DROP POLICY</command> is a <productname>PostgreSQL</productname> extension.
107 </para>
108 </refsect1>
109
110 <refsect1>
111 <title>See Also</title>
112
113 <simplelist type="inline">
114 <member><xref linkend="sql-createpolicy"/></member>
115 <member><xref linkend="sql-alterpolicy"/></member>
116 </simplelist>
117 </refsect1>
118
119 </refentry>