Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 1071861

Browse files
committed
Document new trigger-related forms of ALTER FOREIGN TABLE.
Oversight in commit 7cbe57c. Back-patch to 9.4, where that commit first appeared. In passing, release-note the FDW API postcondition change from the same commit.
1 parent 6636758 commit 1071861

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

doc/src/sgml/ref/alter_foreign_table.sgml

+46
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ ALTER FOREIGN TABLE [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceab
4242
ALTER [ COLUMN ] <replaceable class="PARAMETER">column_name</replaceable> SET ( <replaceable class="PARAMETER">attribute_option</replaceable> = <replaceable class="PARAMETER">value</replaceable> [, ... ] )
4343
ALTER [ COLUMN ] <replaceable class="PARAMETER">column_name</replaceable> RESET ( <replaceable class="PARAMETER">attribute_option</replaceable> [, ... ] )
4444
ALTER [ COLUMN ] <replaceable class="PARAMETER">column_name</replaceable> OPTIONS ( [ ADD | SET | DROP ] <replaceable class="PARAMETER">option</replaceable> ['<replaceable class="PARAMETER">value</replaceable>'] [, ... ])
45+
DISABLE TRIGGER [ <replaceable class="PARAMETER">trigger_name</replaceable> | ALL | USER ]
46+
ENABLE TRIGGER [ <replaceable class="PARAMETER">trigger_name</replaceable> | ALL | USER ]
47+
ENABLE REPLICA TRIGGER <replaceable class="PARAMETER">trigger_name</replaceable>
48+
ENABLE ALWAYS TRIGGER <replaceable class="PARAMETER">trigger_name</replaceable>
4549
OWNER TO <replaceable class="PARAMETER">new_owner</replaceable>
4650
OPTIONS ( [ ADD | SET | DROP ] <replaceable class="PARAMETER">option</replaceable> ['<replaceable class="PARAMETER">value</replaceable>'] [, ... ])
4751
</synopsis>
@@ -148,6 +152,17 @@ ALTER FOREIGN TABLE [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceab
148152
</listitem>
149153
</varlistentry>
150154

155+
<varlistentry>
156+
<term><literal>DISABLE</literal>/<literal>ENABLE [ REPLICA | ALWAYS ] TRIGGER</literal></term>
157+
<listitem>
158+
<para>
159+
These forms configure the firing of trigger(s) belonging to the foreign
160+
table. See the similar form of <xref linkend="sql-altertable"> for more
161+
details.
162+
</para>
163+
</listitem>
164+
</varlistentry>
165+
151166
<varlistentry>
152167
<term><literal>OWNER</literal></term>
153168
<listitem>
@@ -289,6 +304,37 @@ ALTER FOREIGN TABLE [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceab
289304
</listitem>
290305
</varlistentry>
291306

307+
<varlistentry>
308+
<term><replaceable class="PARAMETER">trigger_name</replaceable></term>
309+
<listitem>
310+
<para>
311+
Name of a single trigger to disable or enable.
312+
</para>
313+
</listitem>
314+
</varlistentry>
315+
316+
<varlistentry>
317+
<term><literal>ALL</literal></term>
318+
<listitem>
319+
<para>
320+
Disable or enable all triggers belonging to the foreign table. (This
321+
requires superuser privilege if any of the triggers are internally
322+
generated triggers. The core system does not add such triggers to
323+
foreign tables, but add-on code could do so.)
324+
</para>
325+
</listitem>
326+
</varlistentry>
327+
328+
<varlistentry>
329+
<term><literal>USER</literal></term>
330+
<listitem>
331+
<para>
332+
Disable or enable all triggers belonging to the foreign table except
333+
for internally generated triggers.
334+
</para>
335+
</listitem>
336+
</varlistentry>
337+
292338
<varlistentry>
293339
<term><replaceable class="PARAMETER">new_owner</replaceable></term>
294340
<listitem>

doc/src/sgml/release-9.4.sgml

+12
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,18 @@
191191
</para>
192192
</listitem>
193193

194+
<listitem>
195+
<para>
196+
Writable foreign data wrappers must return all columns when the foreign
197+
table has an <literal>AFTER ROW</> trigger (Noah Misch)
198+
</para>
199+
200+
<para>
201+
Previously, foreign tables never had triggers, and
202+
the <literal>RETURNING</> clause alone dictated the columns required.
203+
</para>
204+
</listitem>
205+
194206
<listitem>
195207
<para>
196208
Rename <link linkend="SQL-EXPLAIN"><command>EXPLAIN

0 commit comments

Comments
 (0)