]> begriffs open source - ai-pg/blob - full-docs/man7/DROP_RULE.7
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / man7 / DROP_RULE.7
1 '\" t
2 .\"     Title: DROP RULE
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 RULE" "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_RULE \- remove a rewrite rule
32 .SH "SYNOPSIS"
33 .sp
34 .nf
35 DROP RULE [ IF EXISTS ] \fIname\fR ON \fItable_name\fR [ CASCADE | RESTRICT ]
36 .fi
37 .SH "DESCRIPTION"
38 .PP
39 \fBDROP RULE\fR
40 drops a rewrite rule\&.
41 .SH "PARAMETERS"
42 .PP
43 IF EXISTS
44 .RS 4
45 Do not throw an error if the rule does not exist\&. A notice is issued in this case\&.
46 .RE
47 .PP
48 \fIname\fR
49 .RS 4
50 The name of the rule to drop\&.
51 .RE
52 .PP
53 \fItable_name\fR
54 .RS 4
55 The name (optionally schema\-qualified) of the table or view that the rule applies to\&.
56 .RE
57 .PP
58 CASCADE
59 .RS 4
60 Automatically drop objects that depend on the rule, and in turn all objects that depend on those objects (see
61 Section\ \&5.15)\&.
62 .RE
63 .PP
64 RESTRICT
65 .RS 4
66 Refuse to drop the rule if any objects depend on it\&. This is the default\&.
67 .RE
68 .SH "EXAMPLES"
69 .PP
70 To drop the rewrite rule
71 newrule:
72 .sp
73 .if n \{\
74 .RS 4
75 .\}
76 .nf
77 DROP RULE newrule ON mytable;
78 .fi
79 .if n \{\
80 .RE
81 .\}
82 .SH "COMPATIBILITY"
83 .PP
84 \fBDROP RULE\fR
85 is a
86 PostgreSQL
87 language extension, as is the entire query rewrite system\&.
88 .SH "SEE ALSO"
89 CREATE RULE (\fBCREATE_RULE\fR(7)), ALTER RULE (\fBALTER_RULE\fR(7))