GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||
GeezerVison is showing www.pgadmin.org — Foreign key Dialog — pgAdmin 4 9.19 documentation
This page in other versions:
Latest
(9.19) | 9.18 | 9.17 | Development
Warning: this documentation is for a pre-release version of pgAdmin 4. Contents
Foreign key Dialog¶Use the Foreign key dialog to specify the behavior of a foreign key constraint. A foreign key constraint maintains referential integrity between two tables. A foreign key constraint cannot be defined between a temporary table and a permanent table. The Foreign key dialog organizes the development of a foreign key constraint through the following dialog tabs: General, Definition, Columns, and Action. The SQL tab displays the SQL code generated by dialog selections.
Use the fields in the General tab to identify the foreign key constraint:
Click the Definition tab to continue.
Use the fields in the Definition tab to define the foreign key constraint:
Click the Columns tab to continue.
Use the fields in the Columns tab to specify one or more reference column(s). A Foreign Key constraint requires that one or more columns of a table must only contain values that match values in the referenced column(s) of a row of a referenced table:
Click the Add icon (+) to add a column to the list; repeat the steps above and click the Add icon (+) to add additional columns. To discard an entry, click the trash icon to the left of the entry and confirm deletion in the Delete Row popup. Click the Action tab to continue.
Use the drop-down listboxes on the Action tab to specify behavior related to the foreign key constraint that will be performed when data within the table is updated or deleted:
The supported actions are:
Click the SQL tab to continue. Your entries in the Foreign key dialog generate a SQL command (see an example below). Use the SQL tab for review; revisit or switch tabs to make any changes to the SQL command. Example¶The following is an example of the sql command generated by user selections in the Foreign key dialog:
The example shown demonstrates creating a foreign key constraint named jobhist_ref_dept_fk that matches values in the jobhist table dept_no column with those of the dept table deptno column.
| ||||||||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |