The code to unlink dropped relations in FinishPreparedTransaction() was
[PostgreSQL.git] / doc / src / sgml / ref / alter_trigger.sgml
blob2e9253ec900591b211bcf767353dfca442c75026
1 <!--
2 $PostgreSQL$
3 PostgreSQL documentation
4 -->
6 <refentry id="SQL-ALTERTRIGGER">
7 <refmeta>
8 <refentrytitle id="sql-altertrigger-title">ALTER TRIGGER</refentrytitle>
9 <manvolnum>7</manvolnum>
10 <refmiscinfo>SQL - Language Statements</refmiscinfo>
11 </refmeta>
13 <refnamediv>
14 <refname>ALTER TRIGGER</refname>
15 <refpurpose>change the definition of a trigger</refpurpose>
16 </refnamediv>
18 <indexterm zone="sql-altertrigger">
19 <primary>ALTER TRIGGER</primary>
20 </indexterm>
22 <refsynopsisdiv>
23 <synopsis>
24 ALTER TRIGGER <replaceable class="PARAMETER">name</replaceable> ON <replaceable class="PARAMETER">table</replaceable> RENAME TO <replaceable class="PARAMETER">newname</replaceable>
25 </synopsis>
26 </refsynopsisdiv>
28 <refsect1>
29 <title>Description</title>
31 <para>
32 <command>ALTER TRIGGER</command> changes properties of an existing
33 trigger. The <literal>RENAME</literal> clause changes the name of
34 the given trigger without otherwise changing the trigger
35 definition.
36 </para>
38 <para>
39 You must own the table on which the trigger acts to be allowed to change its properties.
40 </para>
41 </refsect1>
43 <refsect1>
44 <title>Parameters</title>
46 <variablelist>
47 <varlistentry>
48 <term><replaceable class="PARAMETER">name</replaceable></term>
49 <listitem>
50 <para>
51 The name of an existing trigger to alter.
52 </para>
53 </listitem>
54 </varlistentry>
56 <varlistentry>
57 <term><replaceable class="PARAMETER">table</replaceable></term>
58 <listitem>
59 <para>
60 The name of the table on which this trigger acts.
61 </para>
62 </listitem>
63 </varlistentry>
65 <varlistentry>
66 <term><replaceable class="PARAMETER">newname</replaceable></term>
67 <listitem>
68 <para>
69 The new name for the trigger.
70 </para>
71 </listitem>
72 </varlistentry>
73 </variablelist>
74 </refsect1>
76 <refsect1>
77 <title>Notes</title>
79 <para>
80 The ability to temporarily enable or disable a trigger is provided by
81 <xref linkend="SQL-ALTERTABLE" endterm="SQL-ALTERTABLE-TITLE">, not by
82 <command>ALTER TRIGGER</>, because <command>ALTER TRIGGER</> has no
83 convenient way to express the option of enabling or disabling all of
84 a table's triggers at once.
85 </para>
86 </refsect1>
88 <refsect1>
89 <title>Examples</title>
91 <para>
92 To rename an existing trigger:
93 <programlisting>
94 ALTER TRIGGER emp_stamp ON emp RENAME TO emp_track_chgs;
95 </programlisting>
96 </para>
97 </refsect1>
99 <refsect1>
100 <title>Compatibility</title>
102 <para>
103 <command>ALTER TRIGGER</command> is a <productname>PostgreSQL</>
104 extension of the SQL standard.
105 </para>
106 </refsect1>
108 <refsect1>
109 <title>See Also</title>
111 <simplelist type="inline">
112 <member><xref linkend="sql-altertable" endterm="sql-altertable-title"></member>
113 </simplelist>
114 </refsect1>
115 </refentry>