linkend="SQL-CREATETABLE">.
The DROP CONSTRAINT constraint clause
- drops all CHECK constraints on the table (and its children) that match constraint.
+ drops all constraints on the table (and its children) that match constraint.
The OWNER clause changes the owner of the table to the user
new user.
new default value, using .)
- Currently only CHECK constraints can be dropped from a table. The RESTRICT
- keyword is required, although dependencies are not checked. The CASCADE
- option is unsupported. To remove a PRIMARY or UNIQUE constraint, drop the
- relevant index using the command.
+ In DROP CONSTRAINT, the RESTRICT keyword is required, although
+ dependencies are not yet checked. The CASCADE option is unsupported.
+ Currently DROP CONSTRAINT drops only CHECK constraints.
+ To remove a PRIMARY or UNIQUE constraint, drop the
+ relevant index using the command.
To remove FOREIGN KEY constraints you need to recreate
and reload the table, using other parameters to the
-
- command.
+ command.
For example, to drop all constraints on a table distributors:
To remove a check constraint from a table and all its children:
-ALTER TABLE distributors DROP CONSTRAINT zipchk;
+ALTER TABLE distributors DROP CONSTRAINT zipchk RESTRICT;