Ask a Question
Report a Bug
This page in other versions:
Warning: This documentation is for a pre-release version of pgAdmin 4
Use the Primary key dialog to create or modify a primary key constraint. A
primary key constraint indicates that a column, or group of columns, uniquely
identifies rows in a table. This requires that the values in the selected
column(s) be both unique and not null.
The Primary key dialog organizes the development of a primary key constraint
through the General and Definition tabs. The SQL tab displays the SQL code
generated by dialog selections.
Use the fields in the General tab to identify the primary key:
Click the Definition tab to continue.
Use the fields in the Definition tab to define the primary key constraint:
Click the SQL tab to continue.
Your entries in the Primary 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.
The following is an example of the sql command generated by user selections in
the Primary key dialog:
The example shown demonstrates creating a primary key constraint named
dept_pkey on the dept_id column of the dept table.