PostgreSQL

Скачать в pdf «PostgreSQL»


Inputs


CONSTRAINT name An arbitrary name for the constraint. reftable The table that contains the data to check against.


refeolumn The column in reftable to cheek the data against. If this is not specified, the PRIMARY KEY of the reftable is used.


MATCH matehtype There are three match types: MATCH FULL, MATCH PARTIAL, and a default match type if none is specified. MATCH FULL will not allow one column of a multi-column foreign key to be NULL unless all foreign key columns are NULL. The default MATCH type allows some foreign key columns to be NULL while other parts of the foreign key are not NULL. MATCH PARTIAL is currently not supported.


ON DELETE action The action to do when a referenced row in the referenced table is being deleted. There are the following actions.


NO ACTION Produce error if foreign key violated. This is the default.


RESTRICT Same as NO ACTION.


CASCADE Delete any rows referencing the deleted row.


SET NULL Set the referencing column values to NULL.


SET DEFAULT Set the referencing column values to their default value.


ON UPDATE action The action to do when a referenced column in the referenced table is being updated to a new value. If the row is updated, but the referenced column is not changed, no action is done. There are the following actions.


NO ACTION Produce error if foreign key violated. This is the default.


RESTRICT Same as NO ACTION.


CASCADE Update the value of the referencing column to the new value of the referenced column.

Скачать в pdf «PostgreSQL»