By specifying an ALTER definition (alter_definition) in the ALTER TABLE statement, you can change a CONSTRAINT definition or a key definition.
Syntax
<alter_definition> ::= ALTER CONSTRAINT <constraint_name> CHECK <search_condition> | ALTER <key_definition>
SQL-Tutorial, Primary Key, Constraints
By specifying an ALTER definition you can change a CONSTRAINT definition or a key definition.
The constraint name must identify a CONSTRAINT definition in the table. If the specified search condition is not violated by any row in the table, it replaces the existing search condition of the CONSTRAINT definition. Otherwise, the ALTER TABLE statement fails.
The key specified by the key definition replaces the current key in the table. The columns specified in the key definition must identify columns in the table and have the key property. No key column can therefore have a NULL value and no two rows in the table may have the same values in all key columns.
If a column of the key to be replaced is a referenced column (referenced_column) of a referential CONSTRAINT definition, the ALTER TABLE statement fails.
This may take some time, particularly with longer tables, since extensive copy operations are carried out.