下载吧 - 绿色安全的游戏和软件下载中心

软件下载吧

当前位置:软件下载吧 > 技术开发 > 数据库 > 使用PostgreSQL为表或视图创建备注的操作

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

时间:2024-03-04 00:33作者:下载吧人气:17

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;

标签[db:关键字]

相关下载

查看所有评论+

网友评论

网友
您的评论需要经过审核才能显示

热门阅览

最新排行

公众号