SYSCONSTRAINTS
The sysconstraints system
catalog table lists the constraints placed on the columns in each
database table. An entry is also placed in the sysindexes system
catalog table (or sysindices view for HCL
OneDB™) for
each unique, primary key, or referential constraint that does not
already have a corresponding entry in sysindexes or sysindices.
Because indexes can be shared, more than one constraint can be associated
with an index. The sysconstraints table has the following columns.
Column | Type | Explanation |
---|---|---|
constrid | SERIAL | Code uniquely identifying the constraint |
constrname | VARCHAR(128) | Name of the constraint |
owner | VARCHAR(32) | Name of the owner of the constraint |
tabid | INTEGER | Code uniquely identifying the table |
constrtype | CHAR(1) | Code identifying the constraint type:
|
idxname | VARCHAR(128) | Name of index corresponding to constraint |
collation | CHAR(32) | Collating order at the time when the constraint was created. |
A composite index on the constrname and owner columns allows only unique values. An index on the tabid column allows duplicate values, and an index on the constrid column allows only unique values.
For check constraints (where constrtype = C
),
the idxname is always NULL. Additional information about each
check constraint is contained in the syschecks and syscoldepend system
catalog tables.