supported in 7.1.1, here is a patch to that alter_table.sgml that documents
it.
Christopher Kings-Lynne
- In the current implementation, only FOREIGN KEY constraints can
+ In the current implementation, only FOREIGN KEY and CHECK constraints can
be added to a table. To create or remove a unique constraint, create
a unique index (see
- endterm="SQL-CREATEINDEX-title">). To add check constraints
- you need to recreate and reload the table, using other
- parameters to the
- endterm="SQL-CREATETABLE-title"> command.
+ endterm="SQL-CREATEINDEX-title">).
+ To add a check constraint to a table:
+ALTER TABLE distributors ADD CONSTRAINT zipchk CHECK (char_length(zipcode) = 5)
+
+
+
To add a foreign key constraint to a table: