]> begriffs open source - ai-pg/blob - full-docs/man7/DROP_POLICY.7
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / man7 / DROP_POLICY.7
1 '\" t
2 .\"     Title: DROP POLICY
3 .\"    Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
5 .\"      Date: 2025
6 .\"    Manual: PostgreSQL 18.0 Documentation
7 .\"    Source: PostgreSQL 18.0
8 .\"  Language: English
9 .\"
10 .TH "DROP POLICY" "7" "2025" "PostgreSQL 18.0" "PostgreSQL 18.0 Documentation"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el       .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 DROP_POLICY \- remove a row\-level security policy from a table
32 .SH "SYNOPSIS"
33 .sp
34 .nf
35 DROP POLICY [ IF EXISTS ] \fIname\fR ON \fItable_name\fR [ CASCADE | RESTRICT ]
36 .fi
37 .SH "DESCRIPTION"
38 .PP
39 \fBDROP POLICY\fR
40 removes the specified policy from the table\&. Note that if the last policy is removed for a table and the table still has row\-level security enabled via
41 \fBALTER TABLE\fR, then the default\-deny policy will be used\&.
42 ALTER TABLE \&.\&.\&. DISABLE ROW LEVEL SECURITY
43 can be used to disable row\-level security for a table, whether policies for the table exist or not\&.
44 .SH "PARAMETERS"
45 .PP
46 IF EXISTS
47 .RS 4
48 Do not throw an error if the policy does not exist\&. A notice is issued in this case\&.
49 .RE
50 .PP
51 \fIname\fR
52 .RS 4
53 The name of the policy to drop\&.
54 .RE
55 .PP
56 \fItable_name\fR
57 .RS 4
58 The name (optionally schema\-qualified) of the table that the policy is on\&.
59 .RE
60 .PP
61 CASCADE
62 .br
63 RESTRICT
64 .RS 4
65 These key words do not have any effect, since there are no dependencies on policies\&.
66 .RE
67 .SH "EXAMPLES"
68 .PP
69 To drop the policy called
70 p1
71 on the table named
72 my_table:
73 .sp
74 .if n \{\
75 .RS 4
76 .\}
77 .nf
78 DROP POLICY p1 ON my_table;
79 .fi
80 .if n \{\
81 .RE
82 .\}
83 .SH "COMPATIBILITY"
84 .PP
85 \fBDROP POLICY\fR
86 is a
87 PostgreSQL
88 extension\&.
89 .SH "SEE ALSO"
90 CREATE POLICY (\fBCREATE_POLICY\fR(7)), ALTER POLICY (\fBALTER_POLICY\fR(7))