droptableifexists test;createtable test(
objectid serialnotnull,
num integernotnull,constraint pk_test_objectid primarykey(objectid),constraint ck_test_num check(num <123),);commentontable test is'我是表';commentoncolumn test.objectid is'我是唯一主键';commentoncolumn test.num is'数量字段';commentonconstraint pk_test_objectid on test is'我是约束,唯一主键';commentonconstraint ck_test_num on test is'我是约束,num字段必须小于123';
\dS+ test;
1 为表和列创建备注drop table if exists test;create table test( objectid serial not null, num integer not null, constraint pk_test_objectid primary key (objectid), constraint ck_test_num check(num ...