|
1 | 1 | <!--
|
2 |
| -$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_table.sgml,v 1.30 2001/10/22 18:14:47 petere Exp $ |
| 2 | +$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_table.sgml,v 1.31 2001/11/10 20:13:37 tgl Exp $ |
3 | 3 | Postgres documentation
|
4 | 4 | -->
|
5 | 5 |
|
@@ -178,7 +178,7 @@ ALTER TABLE <replaceable class="PARAMETER">table</replaceable>
|
178 | 178 | adds a new constraint to the table using the same syntax as <xref
|
179 | 179 | linkend="SQL-CREATETABLE">.
|
180 | 180 | The DROP CONSTRAINT <replaceable class="PARAMETER">constraint</replaceable> clause
|
181 |
| - drops allCHECKconstraints on the table (and its children) that match <replaceable class="PARAMETER">constraint</replaceable>. |
| 181 | + drops all constraints on the table (and its children) that match <replaceable class="PARAMETER">constraint</replaceable>. |
182 | 182 | The OWNER clause changes the owner of the table to the user <replaceable class="PARAMETER">
|
183 | 183 | new user</replaceable>.
|
184 | 184 | </para>
|
@@ -207,15 +207,15 @@ ALTER TABLE <replaceable class="PARAMETER">table</replaceable>
|
207 | 207 | new default value, using <xref linkend="sql-update">.)
|
208 | 208 | </para>
|
209 | 209 |
|
210 |
| -<para> |
211 |
| - Currently only CHECK constraints can be dropped from a table. The RESTRICT |
212 |
| - keyword is required, although dependencies are not checked. The CASCADE |
213 |
| - option is unsupported. To remove a PRIMARY or UNIQUE constraint, drop the |
214 |
| - relevant index using the <xref linkend="SQL-DROPINDEX"> command. |
| 210 | + <para> |
| 211 | + In DROP CONSTRAINT, the RESTRICT keyword is required, although |
| 212 | + dependencies are not yet checked. The CASCADE option is unsupported. |
| 213 | + Currently DROP CONSTRAINT drops only CHECK constraints. |
| 214 | + To remove a PRIMARY or UNIQUE constraint, drop the |
| 215 | + relevant index using the <xref linkend="SQL-DROPINDEX"> command. |
215 | 216 | To remove FOREIGN KEY constraints you need to recreate
|
216 | 217 | and reload the table, using other parameters to the
|
217 |
| - <xref linkend="SQL-CREATETABLE"> |
218 |
| - command. |
| 218 | + <xref linkend="SQL-CREATETABLE"> command. |
219 | 219 | </para>
|
220 | 220 | <para>
|
221 | 221 | For example, to drop all constraints on a table <literal>distributors</literal>:
|
@@ -277,7 +277,7 @@ ALTER TABLE distributors ADD CONSTRAINT zipchk CHECK (char_length(zipcode) = 5);
|
277 | 277 | <para>
|
278 | 278 | To remove a check constraint from a table and all its children:
|
279 | 279 | <programlisting>
|
280 |
| -ALTER TABLE distributors DROP CONSTRAINT zipchk; |
| 280 | +ALTER TABLE distributors DROP CONSTRAINT zipchk RESTRICT; |
281 | 281 | </programlisting>
|
282 | 282 | </para>
|
283 | 283 |
|
|