PG sql相关

修改字段

alter table lark_user ALTER department_id type varchar(46) USING department_id::varchar(46) [];

comment on column lark_user.department_id is '用户所属部门的ID列表';

语法备注

ALTER TABLE [ ONLY ] name [ * ]

action [, ... ]

ALTER TABLE [ ONLY ] name [ * ]

RENAME [ COLUMN ] column TO new_column

ALTER TABLE name

RENAME TO new_name

ALTER TABLE name

SET SCHEMA new_schema

where action is one of:

ADD [ COLUMN ] column data_type [ COLLATE collation ] [ column_constraint [ ... ] ]

DROP [ COLUMN ] [ IF EXISTS ] column [ RESTRICT | CASCADE ]

ALTER [ COLUMN ] column [ SET DATA ] TYPE data_type [ COLLATE collation ] [ USING expression ]

ALTER [ COLUMN ] column SET DEFAULT expression

ALTER [ COLUMN ] column DROP DEFAULT

ALTER [ COLUMN ] column { SET | DROP } NOT NULL

ALTER [ COLUMN ] column SET STATISTICS integer

ALTER [ COLUMN ] column SET ( attribute_option = value [, ... ] )

ALTER [ COLUMN ] column RESET ( attribute_option [, ... ] )

ALTER [ COLUMN ] column SET STORAGE { PLAIN | EXTERNAL | EXTENDED | MAIN }

ADD table_constraint [ NOT VALID ]

ADD table_constraint_using_index

VALIDATE CONSTRAINT constraint_name

DROP CONSTRAINT [ IF EXISTS ] constraint_name [ RESTRICT | CASCADE ]

DISABLE TRIGGER [ trigger_name | ALL | USER ]

ENABLE TRIGGER [ trigger_name | ALL | USER ]

ENABLE REPLICA TRIGGER trigger_name

ENABLE ALWAYS TRIGGER trigger_name

DISABLE RULE rewrite_rule_name

ENABLE RULE rewrite_rule_name

ENABLE REPLICA RULE rewrite_rule_name

ENABLE ALWAYS RULE rewrite_rule_name

CLUSTER ON index_name

SET WITHOUT CLUSTER

SET WITH OIDS

SET WITHOUT OIDS

SET ( storage_parameter = value [, ... ] )

RESET ( storage_parameter [, ... ] )

INHERIT parent_table

NO INHERIT parent_table

OF type_name

NOT OF

OWNER TO new_owner

SET TABLESPACE new_tablespace

and table_constraint_using_index is:

[ CONSTRAINT constraint_name ]

{ UNIQUE | PRIMARY KEY } USING INDEX index_name

[ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ]

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值