软件下载吧文章资讯

分类分类

使用PostgreSQL为表或视图创建备注的操作

2024-03-04 00:33作者:下载吧

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 < 123 ),
);
comment on table test is ‘我是表’;
comment on column test.objectid is ‘我是唯一主键’;
comment on column test.num is ‘数量字段’;
comment on constraint pk_test_objectid on test is ‘我是约束,唯一主键’;
comment on constraint ck_test_num on test is ‘我是约束,num字段必须小于123’;
dS+ test;

展开全部

相关文章

说两句网友评论
    我要跟贴
    取消