USER_CONSTRAINTS lists all constraints on tables owned by the current user.
Column reference
| Column | Type | Description |
|---|---|---|
owner | TEXT | The owner of the constraint. |
schema_name | TEXT | The schema to which the constraint belongs. |
constraint_name | TEXT | The name of the constraint. |
constraint_type | TEXT | The type of the constraint. See Constraint types. |
table_name | TEXT | The table to which the constraint belongs. |
search_condition | TEXT | The search condition for a check constraint. |
r_owner | TEXT | The owner of the table referenced by a referential constraint. |
r_constraint_name | TEXT | The name of the constraint defined on the referenced table. |
delete_rule | TEXT | The delete rule for a referential constraint. See Delete rules. |
deferrable | BOOLEAN | Specifies whether the constraint is deferrable. Valid values: T and F. |
deferred | BOOLEAN | Specifies whether the constraint is currently deferred. Valid values: T and F. |
index_owner | TEXT | The owner of the index associated with the constraint. |
index_name | TEXT | The name of the index associated with the constraint. |
constraint_def | TEXT | The definition of the constraint. |
Constraint types
The constraint_type column uses the following values:
C: check constraintF: foreign key constraintP: primary key constraintU: unique key constraintR: referential integrity constraintV: constraint on a viewO: read-only property on a view
Delete rules
The delete_rule column applies to referential constraints and uses the following values:
C: cascadeR: restrictN: no action