Database Designer for PostgreSQL
Constraint Manager | | Previous Next |
Constraint Manager can be used to manage all check, primary and unique constraints within
the diagram. To open Constraint Manager use the Diagram | Constraint Manager menu item.
The main area of the manager is a grid that represents all the constraints and their properties
defined in the diagram excluding foreign key constraints and not null constraints. These properties can
be changed by using Constraint Editor for each constraint one by
one, but using Constraint Manager helps you to do it much more quickly.
You can modify the constraint properties by using the grid:
Constraint Name
On optional name for the constraint. If you don't specify a name, the system chooses a name for
you.
Table
The name of the table on which the constraint is defined. This property can't be changed.
Kind
A kind of the constraint. You can choose one of the following kinds:
CHECK. Is the most generic constraint type. It allows you to specify that the value in certain
columns must satisfy a Boolean (truth-value) expression.
UNIQUE. The unique constraints ensure that the data contained in a column or a group of columns
is unique with respect to all the rows in the table.
PRIMARY KEY. Simply put, it's a combination of a unique constraint and a not-null constraint.
Please note, that you could define primary keys right in the
Column Editor.
Fields
A list of columns on which the current constraint is defined. This field is actual only for
primary key and unique constraints.
Expression
This field can be used for setting boolean expression for a check constraint or setting
additional parameters for primary key and unique constraints.
In case of check constraint. A boolean expression that checks input data. The check expression
should involve the column thus constrained, otherwise the constraint would not make too much sense.
Example expression:
discounted_price > 0
In case of primary key or unique constraint. You can type in any additional parameters
for the constraints of that types. For example, you can set tablespace: TABLESPACE tblsp_name.
To save your changes click the OK button. If you want to store changes and continue
editing, click on the Apply button.