|
1 | 1 | <!--
|
2 |
| -$PostgreSQL: pgsql/doc/src/sgml/ref/alter_table.sgml,v 1.80 2005/08/22 21:32:01 momjian Exp $ |
| 2 | +$PostgreSQL: pgsql/doc/src/sgml/ref/alter_table.sgml,v 1.81 2005/08/24 17:24:19 tgl Exp $ |
3 | 3 | PostgreSQL documentation
|
4 | 4 | -->
|
5 | 5 |
|
@@ -41,6 +41,8 @@ where <replaceable class="PARAMETER">action</replaceable> is one of:
|
41 | 41 | ALTER [ COLUMN ] <replaceable class="PARAMETER">column</replaceable> SET STORAGE { PLAIN | EXTERNAL | EXTENDED | MAIN }
|
42 | 42 | ADD <replaceable class="PARAMETER">table_constraint</replaceable>
|
43 | 43 | DROP CONSTRAINT <replaceable class="PARAMETER">constraint_name</replaceable> [ RESTRICT | CASCADE ]
|
| 44 | + DISABLE TRIGGER [ <replaceable class="PARAMETER">trigger_name</replaceable> | ALL | USER ] |
| 45 | + ENABLE TRIGGER [ <replaceable class="PARAMETER">trigger_name</replaceable> | ALL | USER ] |
44 | 46 | CLUSTER ON <replaceable class="PARAMETER">index_name</replaceable>
|
45 | 47 | SET WITHOUT CLUSTER
|
46 | 48 | SET WITHOUT OIDS
|
@@ -189,6 +191,25 @@ where <replaceable class="PARAMETER">action</replaceable> is one of:
|
189 | 191 | </listitem>
|
190 | 192 | </varlistentry>
|
191 | 193 |
|
| 194 | + <varlistentry> |
| 195 | + <term><literal>DISABLE</literal>/<literal>ENABLE TRIGGER</literal></term> |
| 196 | + <listitem> |
| 197 | + <para> |
| 198 | + These forms disable or enable trigger(s) belonging to the table. |
| 199 | + A disabled trigger is still known to the system, but is not executed |
| 200 | + when its triggering event occurs. For a deferred trigger, the enable |
| 201 | + status is checked when the event occurs, not when the trigger function |
| 202 | + is actually executed. One may disable or enable a single |
| 203 | + trigger specified by name, or all triggers on the table, or only |
| 204 | + user triggers (this option excludes triggers that are used to implement |
| 205 | + foreign key constraints). Disabling or enabling constraint triggers |
| 206 | + requires superuser privileges; it should be done with caution since |
| 207 | + of course the integrity of the constraint cannot be guaranteed if the |
| 208 | + triggers are not executed. |
| 209 | + </para> |
| 210 | + </listitem> |
| 211 | + </varlistentry> |
| 212 | + |
192 | 213 | <varlistentry>
|
193 | 214 | <term><literal>CLUSTER</literal></term>
|
194 | 215 | <listitem>
|
@@ -292,8 +313,11 @@ where <replaceable class="PARAMETER">action</replaceable> is one of:
|
292 | 313 | You must own the table to use <command>ALTER TABLE</>.
|
293 | 314 | To change the schema of a table, you must also have
|
294 | 315 | <literal>CREATE</literal> privilege on the new schema.
|
295 |
| - To alter the owner, the new owner must have |
296 |
| - <literal>CREATE</literal> privilege on the schema. |
| 316 | + To alter the owner, you must also be a direct or indirect member of the new |
| 317 | + owning role, and that role must have <literal>CREATE</literal> privilege on |
| 318 | + the table's schema. (These restrictions enforce that altering the owner |
| 319 | + doesn't do anything you couldn't do by dropping and recreating the table. |
| 320 | + However, a superuser can alter ownership of any table anyway.) |
297 | 321 | </para>
|
298 | 322 | </refsect1>
|
299 | 323 |
|
@@ -394,6 +418,36 @@ where <replaceable class="PARAMETER">action</replaceable> is one of:
|
394 | 418 | </listitem>
|
395 | 419 | </varlistentry>
|
396 | 420 |
|
| 421 | + <varlistentry> |
| 422 | + <term><replaceable class="PARAMETER">trigger_name</replaceable></term> |
| 423 | + <listitem> |
| 424 | + <para> |
| 425 | + Name of a single trigger to disable or enable. |
| 426 | + </para> |
| 427 | + </listitem> |
| 428 | + </varlistentry> |
| 429 | + |
| 430 | + <varlistentry> |
| 431 | + <term><literal>ALL</literal></term> |
| 432 | + <listitem> |
| 433 | + <para> |
| 434 | + Disable or enable all triggers belonging to the table. |
| 435 | + (This requires superuser privilege if any of the triggers are for |
| 436 | + foreign key constraints.) |
| 437 | + </para> |
| 438 | + </listitem> |
| 439 | + </varlistentry> |
| 440 | + |
| 441 | + <varlistentry> |
| 442 | + <term><literal>USER</literal></term> |
| 443 | + <listitem> |
| 444 | + <para> |
| 445 | + Disable or enable all triggers belonging to the table except for |
| 446 | + foreign key constraint triggers. |
| 447 | + </para> |
| 448 | + </listitem> |
| 449 | + </varlistentry> |
| 450 | + |
397 | 451 | <varlistentry>
|
398 | 452 | <term><replaceable class="PARAMETER">index_name</replaceable></term>
|
399 | 453 | <listitem>
|
@@ -524,6 +578,13 @@ ALTER TABLE table ALTER COLUMN anycol TYPE anytype;
|
524 | 578 | instead marks them as independently defined rather than inherited.
|
525 | 579 | </para>
|
526 | 580 |
|
| 581 | + <para> |
| 582 | + The <literal>TRIGGER</>, <literal>CLUSTER</>, <literal>OWNER</>, |
| 583 | + and <literal>TABLESPACE</> actions never recurse to descendant tables; |
| 584 | + that is, they always act as though <literal>ONLY</> were specified. |
| 585 | + Adding a constraint can recurse only for <literal>CHECK</> constraints. |
| 586 | + </para> |
| 587 | + |
527 | 588 | <para>
|
528 | 589 | Changing any part of a system catalog table is not permitted.
|
529 | 590 | </para>
|
|
0 commit comments