数据仓库服务 GAUSSDB(DWS)-ALTER SEQUENCE:示例

时间:2024-10-21 16:50:36

示例

将序列serial的最大值修改为200:

1
ALTER SEQUENCE serial MAXVALUE 200;

创建一个表,定义默认值:

1
CREATE TABLE T1(C1 bigint default nextval('serial'));

将序列serial的归属列变为T1.C1:

1
ALTER SEQUENCE serial OWNED BY T1.C1;

更改序列serial的增量值和缓存值:

1
ALTER SEQUENCE serial CACHE 5;
support.huaweicloud.com/sqlreference-830-dws/dws_06_0137.html