TABLE_CONSTRAINTS

Provides information about table constraints.

Column Name Data Type Description
CONSTRAINT_ID

INTEGER

Catalog-assigned integer value that uniquely identifies the constraint.

CONSTRAINT_NAME

VARCHAR

The name of the constraint, if specified as UNIQUE, FOREIGN KEY, NOT NULL, PRIMARY KEY, or CHECK.

CONSTRAINT_SCHEMA_ID

INTEGER

Catalog-assigned integer value that uniquely identifies the schema containing the constraint.

CONSTRAINT_KEY_COUNT

INTEGER

The number of constraint keys.

FOREIGN_KEY_COUNT

INTEGER

The number of foreign keys.

TABLE_ID

INTEGER

Catalog-assigned integer value that uniquely identifies the table.

TABLE_NAME
VARCHAR The name of the table that contains the UNIQUE, FOREIGN KEY, NOT NULL, or PRIMARY KEY constraint
FOREIGN_TABLE_ID

INTEGER

The unique object ID of the foreign table referenced in a foreign key constraint (zero if not a foreign key constraint).

CONSTRAINT_TYPE

CHAR

Indicates the constraint type.

Valid Values:

  • c — check
  • f — foreign
  • p — primary
  • u — unique
IS_ENABLED
        

BOOLEAN

Indicates if a constraint for a primary key, unique key, or check constraint is currently enabled. Can be t (True) or f (False).

PREDICATE
VARCHAR For check constraints, the SQL expression.

See Also

ANALYZE_CONSTRAINTS