上海網(wǎng)站建設(shè)公司地廣州專業(yè)seo公司
功能介紹
Oracle數(shù)據(jù)庫(kù)在創(chuàng)建sequence的時(shí)候可以支持設(shè)置maxvalue 為9999999999999999999999999999,這樣的SQL在LightDB23.3版本之前都是執(zhí)行失敗的。為了方便Oracle用戶遷移到LightDB上,在LightDB23.3版本上,增加了sequence支持maxvalue設(shè)置為9999999999999999999999999999的語(yǔ)法兼容。
如果設(shè)置的maxvalue的值大于INT64_MAX(9223372036854775807),則設(shè)置maxvalue為sequence類型所對(duì)應(yīng)的最大值。
使用說(shuō)明
- 創(chuàng)建sequence時(shí)設(shè)置maxvalue為9999999999999999999999999999
lightdb@lt_test=# create sequence s1 maxvalue 9999999999999999999999999999;
CREATE SEQUENCE
lightdb@lt_test=# \d+ s1Sequence "public.s1"Type | Start | Minimum | Maximum | Increment | Cycles? | Cache
--------+-------+---------+---------------------+-----------+---------+-------bigint | 1 | 1 | 9223372036854775807 | 1 | no | 1lightdb@lt_test=#
- 修改sequence時(shí)設(shè)置maxvalue為9999999999999999999999999999
lightdb@lt_test=# create sequence s2 maxvalue 100000;
CREATE SEQUENCE
lightdb@lt_test=# \d+ s2Sequence "public.s2"Type | Start | Minimum | Maximum | Increment | Cycles? | Cache
--------+-------+---------+---------+-----------+---------+-------bigint | 1 | 1 | 100000 | 1 | no | 1lightdb@lt_test=#
lightdb@lt_test=# alter sequence s2 maxvalue 9999999999999999999999999999;
ALTER SEQUENCE
lightdb@lt_test=# \d+ s2Sequence "public.s2"Type | Start | Minimum | Maximum | Increment | Cycles? | Cache
--------+-------+---------+---------------------+-----------+---------+-------bigint | 1 | 1 | 9223372036854775807 | 1 | no | 1lightdb@lt_test=#
- 當(dāng)sequence類型為smallint時(shí),設(shè)置maxvalue為9999999999999999999999999999
lightdb@lt_test=# create sequence s3 as smallint maxvalue 1000;
CREATE SEQUENCE
lightdb@lt_test=# \d+ s3Sequence "public.s3"Type | Start | Minimum | Maximum | Increment | Cycles? | Cache
----------+-------+---------+---------+-----------+---------+-------smallint | 1 | 1 | 1000 | 1 | no | 1lightdb@lt_test=# alter sequence s3 maxvalue 9999999999999999999999999999;
ALTER SEQUENCE
lightdb@lt_test=# \d+ s3Sequence "public.s3"Type | Start | Minimum | Maximum | Increment | Cycles? | Cache
----------+-------+---------+---------+-----------+---------+-------smallint | 1 | 1 | 32767 | 1 | no | 1lightdb@lt_test=#