]> granicus.if.org Git - postgresql/blob - doc/src/sgml/ref/alter_rule.sgml
Add support for piping COPY to/from an external program.
[postgresql] / doc / src / sgml / ref / alter_rule.sgml
1 <!--
2 doc/src/sgml/ref/alter_rule.sgml
3 PostgreSQL documentation
4 -->
5
6 <refentry id="SQL-ALTERRULE">
7  <refmeta>
8   <refentrytitle>ALTER RULE</refentrytitle>
9   <manvolnum>7</manvolnum>
10   <refmiscinfo>SQL - Language Statements</refmiscinfo>
11  </refmeta>
12
13  <refnamediv>
14   <refname>ALTER RULE</refname>
15   <refpurpose>change the definition of a rule</refpurpose>
16  </refnamediv>
17
18  <indexterm zone="sql-alterrule">
19   <primary>ALTER RULE</primary>
20  </indexterm>
21
22  <refsynopsisdiv>
23 <synopsis>
24 ALTER RULE <replaceable class="PARAMETER">name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> RENAME TO <replaceable class="PARAMETER">new_name</replaceable>
25 </synopsis>
26  </refsynopsisdiv>
27
28  <refsect1>
29   <title>Description</title>
30
31   <para>
32    <command>ALTER RULE</command> changes properties of an existing
33    rule.  Currently, the only available action is to change the rule's name.
34   </para>
35
36   <para>
37    To use <command>ALTER RULE</command>, you must own the table or view that
38    the rule applies to.
39   </para>
40  </refsect1>
41
42  <refsect1>
43   <title>Parameters</title>
44
45   <variablelist>
46    <varlistentry>
47     <term><replaceable class="PARAMETER">name</replaceable></term>
48     <listitem>
49      <para>
50       The name of an existing rule to alter.
51      </para>
52     </listitem>
53    </varlistentry>
54
55    <varlistentry>
56     <term><replaceable class="PARAMETER">table_name</replaceable></term>
57     <listitem>
58      <para>
59       The name (optionally schema-qualified) of the table or view that the
60       rule applies to.
61      </para>
62     </listitem>
63    </varlistentry>
64
65    <varlistentry>
66     <term><replaceable class="PARAMETER">new_name</replaceable></term>
67     <listitem>
68      <para>
69       The new name for the rule.
70      </para>
71     </listitem>
72    </varlistentry>
73   </variablelist>
74  </refsect1>
75
76  <refsect1>
77   <title>Examples</title>
78
79   <para>
80    To rename an existing rule:
81 <programlisting>
82 ALTER RULE notify_all ON emp RENAME TO notify_me;
83 </programlisting></para>
84  </refsect1>
85
86  <refsect1>
87   <title>Compatibility</title>
88
89   <para>
90    <command>ALTER RULE</command> is a
91    <productname>PostgreSQL</productname> language extension, as is the
92    entire query rewrite system.
93   </para>
94  </refsect1>
95
96  <refsect1>
97   <title>See Also</title>
98
99   <simplelist type="inline">
100    <member><xref linkend="sql-createrule"></member>
101    <member><xref linkend="sql-droprule"></member>
102   </simplelist>
103  </refsect1>
104
105 </refentry>