sysconstraints 系统目录表列出了对每个数据库表中的各个列设置的约束。在
sysindexes 系统目录表(或 GBase 8s 的 sysindices 视图)中对在 sysindexes 或
GBase 8s SQL 指南:参考
南大通用数据技术股份有限公司 - 34 -
sysindices 中尚未有对应条目的每个唯一的主键或引用约束也设置了一个条目。由于索引
可以共享,所以多个约束可以与一个索引相关联。sysconstraints 表具有以下列。
表 11. SYSCONSTRAINTS 表列描述
列
类型
解释
constrid
SERIAL
唯一地标识约束的代码
constrname
VARCHAR(128)
约束的名称
owner
VARCHAR(32)
约束所有者的名称
tabid
INTEGER
唯一地标识表的代码
constrtype
CHAR(1)
标识约束类型的代码:
C = 检查约束
N = Not NULL
P = 主键
R = 引用
T = 表
U = 唯一
idxname
VARCHAR(128)
与约束相对应的索引的名
称
collation
CHAR(32)
创建约束时的排列顺序。
constrname 和 owner 列的组合索引只允许唯一值。tabid 列的索引允许重复值,但
constrid 列的索引只允许唯一值。
对于检查约束(其中 constrtype = C),idxname 始终为 NULL。有关每个检查约束
的其他信息包括在 syschecks 和 syscoldepend 系统目录表中。