mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Add support for ALTER RULE ... RENAME TO.
Ali Dar, reviewed by Dean Rasheed.
This commit is contained in:
@ -25,6 +25,7 @@ Complete list of usable sgml source files in this directory.
|
||||
<!ENTITY alterOperatorClass SYSTEM "alter_opclass.sgml">
|
||||
<!ENTITY alterOperatorFamily SYSTEM "alter_opfamily.sgml">
|
||||
<!ENTITY alterRole SYSTEM "alter_role.sgml">
|
||||
<!ENTITY alterRule SYSTEM "alter_rule.sgml">
|
||||
<!ENTITY alterSchema SYSTEM "alter_schema.sgml">
|
||||
<!ENTITY alterServer SYSTEM "alter_server.sgml">
|
||||
<!ENTITY alterSequence SYSTEM "alter_sequence.sgml">
|
||||
|
105
doc/src/sgml/ref/alter_rule.sgml
Normal file
105
doc/src/sgml/ref/alter_rule.sgml
Normal file
@ -0,0 +1,105 @@
|
||||
<!--
|
||||
doc/src/sgml/ref/alter_rule.sgml
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
<refentry id="SQL-ALTERRULE">
|
||||
<refmeta>
|
||||
<refentrytitle>ALTER RULE</refentrytitle>
|
||||
<manvolnum>7</manvolnum>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>ALTER RULE</refname>
|
||||
<refpurpose>change the definition of a rule</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-alterrule">
|
||||
<primary>ALTER RULE</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
ALTER RULE <replaceable class="PARAMETER">name</replaceable> ON <replaceable class="PARAMETER">table_name</replaceable> RENAME TO <replaceable class="PARAMETER">new_name</replaceable>
|
||||
</synopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
|
||||
<para>
|
||||
<command>ALTER RULE</command> changes properties of an existing
|
||||
rule. Currently, the only available action is to change the rule's name.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
To use <command>ALTER RULE</command>, you must own the table or view that
|
||||
the rule applies to.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Parameters</title>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><replaceable class="PARAMETER">name</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of an existing rule to alter.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><replaceable class="PARAMETER">table_name</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name (optionally schema-qualified) of the table or view that the
|
||||
rule applies to.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><replaceable class="PARAMETER">new_name</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The new name for the rule.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Examples</title>
|
||||
|
||||
<para>
|
||||
To rename an existing rule:
|
||||
<programlisting>
|
||||
ALTER RULE notify_all ON emp RENAME TO notify_me;
|
||||
</programlisting></para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Compatibility</title>
|
||||
|
||||
<para>
|
||||
<command>ALTER RULE</command> is a
|
||||
<productname>PostgreSQL</productname> language extension, as is the
|
||||
entire query rewrite system.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>See Also</title>
|
||||
|
||||
<simplelist type="inline">
|
||||
<member><xref linkend="sql-createrule"></member>
|
||||
<member><xref linkend="sql-droprule"></member>
|
||||
</simplelist>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
@ -284,4 +284,14 @@ UPDATE mytable SET name = 'foo' WHERE id = 42;
|
||||
entire query rewrite system.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>See Also</title>
|
||||
|
||||
<simplelist type="inline">
|
||||
<member><xref linkend="sql-alterrule"></member>
|
||||
<member><xref linkend="sql-droprule"></member>
|
||||
</simplelist>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
@ -103,7 +103,9 @@ DROP RULE newrule ON mytable;
|
||||
<title>Compatibility</title>
|
||||
|
||||
<para>
|
||||
There is no <command>DROP RULE</command> statement in the SQL standard.
|
||||
<command>DROP RULE</command> is a
|
||||
<productname>PostgreSQL</productname> language extension, as is the
|
||||
entire query rewrite system.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
@ -112,6 +114,7 @@ DROP RULE newrule ON mytable;
|
||||
|
||||
<simplelist type="inline">
|
||||
<member><xref linkend="sql-createrule"></member>
|
||||
<member><xref linkend="sql-alterrule"></member>
|
||||
</simplelist>
|
||||
</refsect1>
|
||||
|
||||
|
@ -53,6 +53,7 @@
|
||||
&alterOperatorClass;
|
||||
&alterOperatorFamily;
|
||||
&alterRole;
|
||||
&alterRule;
|
||||
&alterSchema;
|
||||
&alterSequence;
|
||||
&alterServer;
|
||||
|
Reference in New Issue
Block a user