鲜花网站前台数据库建设,上海民营企业500强,王色网站,外网搭建背景介绍
Oracle数据库支持设置sequence的minvalue为-1000000000000000000000000000#xff0c;在用户迁移到LightDB时#xff0c;sequence设置minvalue为-1000000000000000000000000000会报错。为了兼容Oracle数据库的使用习惯#xff0c;在LightDB24.1版本中#xff0c;…背景介绍
Oracle数据库支持设置sequence的minvalue为-1000000000000000000000000000在用户迁移到LightDB时sequence设置minvalue为-1000000000000000000000000000会报错。为了兼容Oracle数据库的使用习惯在LightDB24.1版本中对于minvalue小于INT64_MIN-9223372036854775808做了处理使得minvalue值被设置为INT64_MIN。
使用约束
oracle兼容模式下生效
使用示例
在oracle兼容模式下
lightdboracle_test# show lightdb_dblevel_syntax_compatible_type ;lightdb_dblevel_syntax_compatible_type
----------------------------------------Oracle
(1 row)lightdboracle_test# create sequence s1 minvalue -1000000000000000000000000000;
NOTICE: minvalue out of range, set sequence min value to -9223372036854775808
CREATE SEQUENCE
lightdboracle_test# \d s1Sequence public.s1Type | Start | Minimum | Maximum | Increment | Cycles? | Cache
----------------------------------------------------------------------------------------------------bigint | -9223372036854775808 | -9223372036854775808 | 9223372036854775807 | 1 | no | 1lightdboracle_test# 非oracle兼容模式
lightdbpostgres# show lightdb_dblevel_syntax_compatible_type ;lightdb_dblevel_syntax_compatible_type
----------------------------------------off
(1 row)lightdbpostgres#
lightdbpostgres# create sequence s1 minvalue -1000000000000000000000000000;
ERROR: value -1000000000000000000000000000 is out of range for type bigint
lightdbpostgres# \d s1
Did not find any relation named s1.
lightdbpostgres#