小编Vin*_*non的帖子

对复合类型的约束

如何在复合类型的子字段上创建约束?

伪代码

create type axis(
    major_axis float,
    minor_axis float,
    angle float constraint angle_constraint check(angle between -90 and 90)
);

create table sample(
    axis1 axis,
    axis2 axis
);
Run Code Online (Sandbox Code Playgroud)

这在 PostgreSQL 9.2 中可能吗?正如这里提到的那样,在 9.1 中似乎是不可能的。

postgresql constraint postgresql-9.2

7
推荐指数
1
解决办法
1843
查看次数

标签 统计

constraint ×1

postgresql ×1

postgresql-9.2 ×1