|
1 | 1 | <!--
|
2 |
| -$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_table.sgml,v 1.45 2002/05/18 15:44:47 petere Exp $ |
| 2 | +$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_table.sgml,v 1.46 2002/07/12 18:43:12 tgl Exp $ |
3 | 3 | PostgreSQL documentation
|
4 | 4 | -->
|
5 | 5 |
|
@@ -39,7 +39,7 @@ ALTER TABLE <replaceable class="PARAMETER">table</replaceable>
|
39 | 39 | ALTER TABLE <replaceable class="PARAMETER">table</replaceable>
|
40 | 40 | ADD <replaceable class="PARAMETER">table_constraint_definition</replaceable>
|
41 | 41 | ALTER TABLE [ ONLY ] <replaceable class="PARAMETER">table</replaceable>
|
42 |
| - DROP CONSTRAINT <replaceable class="PARAMETER">constraint_name</replaceable> { RESTRICT | CASCADE } |
| 42 | + DROP CONSTRAINT <replaceable class="PARAMETER">constraint_name</replaceable> [ RESTRICT | CASCADE ] |
43 | 43 | ALTER TABLE <replaceable class="PARAMETER">table</replaceable>
|
44 | 44 | OWNER TO <replaceable class="PARAMETER">new_owner</replaceable>
|
45 | 45 | </synopsis>
|
@@ -315,26 +315,6 @@ ALTER TABLE <replaceable class="PARAMETER">table</replaceable>
|
315 | 315 | form after you've entered non-null values for the column in all rows.
|
316 | 316 | </para>
|
317 | 317 |
|
318 |
| - <para> |
319 |
| - In DROP CONSTRAINT, the RESTRICT keyword is required, although |
320 |
| - dependencies are not yet checked. The CASCADE option is unsupported. |
321 |
| - Currently DROP CONSTRAINT only handles CHECK constraints. |
322 |
| - To remove a PRIMARY or UNIQUE constraint, drop the |
323 |
| - relevant index using the <xref linkend="SQL-DROPINDEX" endterm="sql-dropindex-title"> command. |
324 |
| - To remove FOREIGN KEY constraints you need to recreate |
325 |
| - and reload the table, using other parameters to the |
326 |
| - <xref linkend="SQL-CREATETABLE" endterm="sql-createtable-title"> command. |
327 |
| - </para> |
328 |
| - <para> |
329 |
| - For example, to drop all constraints on a table <literal>distributors</literal>: |
330 |
| - <programlisting> |
331 |
| -CREATE TABLE temp AS SELECT * FROM distributors; |
332 |
| -DROP TABLE distributors; |
333 |
| -CREATE TABLE distributors AS SELECT * FROM temp; |
334 |
| -DROP TABLE temp; |
335 |
| - </programlisting> |
336 |
| - </para> |
337 |
| - |
338 | 318 | <para>
|
339 | 319 | Changing any part of the schema of a system
|
340 | 320 | catalog is not permitted.
|
@@ -395,7 +375,7 @@ ALTER TABLE distributors ADD CONSTRAINT zipchk CHECK (char_length(zipcode) = 5);
|
395 | 375 | <para>
|
396 | 376 | To remove a check constraint from a table and all its children:
|
397 | 377 | <programlisting>
|
398 |
| -ALTER TABLE distributors DROP CONSTRAINT zipchk RESTRICT; |
| 378 | +ALTER TABLE distributors DROP CONSTRAINT zipchk; |
399 | 379 | </programlisting>
|
400 | 380 | </para>
|
401 | 381 |
|
|
0 commit comments