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

时间:2024-12-06 15:12:41

示例

将序列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-910-dws/dws_06_0137.html