Choose your SQL server:
AnySQL
MySQL
MS SQL Server
PostgreSQL
Oracle
SQL Anywhere
DB2
SQLite
Firebird
MaxDB

Subscribe to our newsletter

PostgreSQL Maestro online Help

Prev  Return to chapter overview Next 

Setting reference options

Set the Foreign Key Name, select Columns from the Available Fields list to include into the foreign key, select the Foreign Table Name from the drop-down list and its fields from the list to include, set other foreign key properties and apply the changes by clicking the OK button.

 

 

All the fields which are included into the Foreign Key must be included into indexes as well. See Indexes for details.

 

 

Set rules ON DELETE and ON UPDATE from the respective drop-down lists.

 

NO ACTION Produce an error indicating that the deletion or update will create a foreign key constraint violation. If the constraint is deferred this error will be produced at constraint check time if there still exist any referencing rows. This is the default action.

 

RESTRICT Produce an error indicating that the deletion or update would create a foreign key constraint violation. This is the same as NO ACTION except that the check is not deferrable.

 

CASCADE Delete any rows referencing the deleted row, or update the value of the referencing column to the new value of the referenced column, respectively.

 

SET NULL Set the referencing column(s) to null.

 

SET DEFAULT Set the referencing column(s) to their default values.


Prev  Return to chapter overview Next