]> begriffs open source - ai-pg/blob - full-docs/man7/ALTER_RULE.7
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / man7 / ALTER_RULE.7
1 '\" t
2 .\"     Title: ALTER 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 "ALTER 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 ALTER_RULE \- change the definition of a rule
32 .SH "SYNOPSIS"
33 .sp
34 .nf
35 ALTER RULE \fIname\fR ON \fItable_name\fR RENAME TO \fInew_name\fR
36 .fi
37 .SH "DESCRIPTION"
38 .PP
39 \fBALTER RULE\fR
40 changes properties of an existing rule\&. Currently, the only available action is to change the rule\*(Aqs name\&.
41 .PP
42 To use
43 \fBALTER RULE\fR, you must own the table or view that the rule applies to\&.
44 .SH "PARAMETERS"
45 .PP
46 \fIname\fR
47 .RS 4
48 The name of an existing rule to alter\&.
49 .RE
50 .PP
51 \fItable_name\fR
52 .RS 4
53 The name (optionally schema\-qualified) of the table or view that the rule applies to\&.
54 .RE
55 .PP
56 \fInew_name\fR
57 .RS 4
58 The new name for the rule\&.
59 .RE
60 .SH "EXAMPLES"
61 .PP
62 To rename an existing rule:
63 .sp
64 .if n \{\
65 .RS 4
66 .\}
67 .nf
68 ALTER RULE notify_all ON emp RENAME TO notify_me;
69 .fi
70 .if n \{\
71 .RE
72 .\}
73 .SH "COMPATIBILITY"
74 .PP
75 \fBALTER RULE\fR
76 is a
77 PostgreSQL
78 language extension, as is the entire query rewrite system\&.
79 .SH "SEE ALSO"
80 CREATE RULE (\fBCREATE_RULE\fR(7)), DROP RULE (\fBDROP_RULE\fR(7))