Exclusion Constraints, Primary Keys, and Unique Keys Wizards (PostgreSQL)
Go Up to PostgreSQL Object Wizards
The wizards for creating these object types let you build and submit an ALTER TABLE... ADD CONSTRAINT... statements specific to the object type.
- Note: Before working with these object types, consult PostgreSQL documentation. For more information, see Accessing Third Party Documentation.
To create a new exclusion constraint, primary key, or unique key using a wizard
- Open a creation wizard for the target object type. For details, see Opening an Object Wizard.
- Use the following topics as a guide to setting properties and performing tasks as you pass through the wizard panels:
- Properties panel - Exclusion Constraints, Primary Keys and Unique Keys (PostgreSQL) - Properties.
- Constraints panel - Exclusion Constraints, Primary Keys, and Unique Keys (PostgreSQL) - Columns.
- Comment panel - for details, see Adding a Comment to an Object.
- DDL View panel - for details, see Previewing the DDL Generated to Create the New Object.
- Finally, use the Execute button to create the object.
Exclusion Constraints, Primary Keys and Unique Keys (PostgreSQL) - Properties
When creating or editing an exclusion constraint, primary key, or unique key, this tab/panel lets you work with the following settings:
Setting | Availability and Description |
---|---|
Table Schema and Table Name |
Select the schema and name of the parent table. |
Name |
Provide a name for the object being created. |
Index Name |
Primary Keys and Unique Keys only. Lets you provide the name of an existing index that will be used as the base for the primary or unique key. |
Deferrable |
If selected, a DEFERRABLE parameter is included in the generated DDL, specifying that checking of constraints can be postponed until the end of the transaction. |
Deferred |
If IMMEDIATE is not selected, an INITIALLY DEFERRED parameter is added to the generated DDL, ensuring that the constraint is checked at the end of the transaction. |
Predicate |
Exclusion Constraints only. Lets you provide an expression used in a WHERE clause that defines the constraint on a subset of the table. |
Access Name |
Exclusion Constraints only. Lets you select an index method (btree, gist, hash, or spgist) for the USING option of the EXCLUDE clause. |
Tablespace |
Lets you optionally select the tablespace on which the new or altered object is to be created. If not specified, the default tablespace will be used. |
Fill Factor |
Lets you provide a FILLFACTOR value, specifying the percentage of tables that can be packed. |
Buffering |
Excusion constraints only. Only available with an Access Name of gist. Lets you select a BUFFERING value (AUTO, ON, or OFF). |
Exclusion Constraints, Primary Keys, and Unique Keys (PostgreSQL) - Columns
When creating or editing an exclusion constraint, this tab/panel lets you set up the operators on the columns or expressions that define the exclusion constraint.