All Products
Search
Document Center

PolarDB:DBA_CONSTRAINTS

Last Updated:Mar 28, 2026

DBA_CONSTRAINTS lists all constraints defined on tables across the entire database.

Columns

ColumnTypeDescription
ownerTEXTUsername of the constraint owner.
schema_nameTEXTName of the schema that contains the constraint.
constraint_nameTEXTName of the constraint.
constraint_typeTEXTType of the constraint. Valid values: C (check), F (foreign key), P (primary key), U (unique key), R (referential integrity), V (constraint on a view), O (read-only on a view).
table_nameTEXTName of the table the constraint belongs to.
search_conditionTEXTSearch condition for a check constraint.
r_ownerTEXTOwner of the table referenced by a referential constraint.
r_constraint_nameTEXTName of the constraint definition on the referenced table.
delete_ruleTEXTDelete rule for a referential constraint. Valid values: C (cascade), R (restrict), N (no action).
deferrableBOOLEANWhether the constraint is deferrable. T = deferrable, F = not deferrable.
deferredBOOLEANWhether the constraint is currently deferred. T = deferred, F = not deferred.
index_ownerTEXTUsername of the index owner.
index_nameTEXTName of the index associated with the constraint.
constraint_defTEXTDefinition of the constraint.

Example

The following query retrieves all constraints on the EMPLOYEES table, including their types and delete rules:

SELECT constraint_name, constraint_type, search_condition, delete_rule
FROM dba_constraints
WHERE table_name = 'EMPLOYEES';