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 Unique constraint dialog to define a unique constraint for a specified
table. Unique constraints ensure that the data contained in a column, or a group
of columns, is unique among all the rows in the table.
The Unique constraint dialog organizes the development of a unique constraint
through the following dialog tabs: General and Definition. The SQL tab
displays the SQL code generated by dialog selections.
Use the fields in the General tab to identify the unique constraint:
Click the Definition tab to continue.
Use the fields in the Definition tab to define the unique constraint:
Click the SQL tab to continue.
Your entries in the Unique constraint 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 Unique constraint dialog:
The example shown demonstrates creating a unique constraint named name_con on
the name column of the distributors table.