LightDB24.1 Sequence支持设置minvalue小于INT64_MIN

背景介绍

Oracle数据库支持设置sequence的minvalue为-1000000000000000000000000000,在用户迁移到LightDB时,sequence设置minvalue为-1000000000000000000000000000会报错。为了兼容Oracle数据库的使用习惯,在LightDB24.1版本中,对于minvalue小于INT64_MIN(-9223372036854775808)做了处理,使得minvalue值被设置为INT64_MIN。

使用约束:

  • oracle兼容模式下生效

使用示例

  1. 在oracle兼容模式下
lightdb@oracle_test=# show lightdb_dblevel_syntax_compatible_type ;
 lightdb_dblevel_syntax_compatible_type 
----------------------------------------
 Oracle
(1 row)

lightdb@oracle_test=# create sequence s1 minvalue -1000000000000000000000000000;
NOTICE:  minvalue out of range, set sequence min value to -9223372036854775808
CREATE SEQUENCE
lightdb@oracle_test=# \d+ s1
                                           Sequence "public.s1"
  Type  |        Start         |       Minimum        |       Maximum       | Increment | Cycles? | Cache 
--------+----------------------+----------------------+---------------------+-----------+---------+-------
 bigint | -9223372036854775808 | -9223372036854775808 | 9223372036854775807 |         1 | no      |     1

lightdb@oracle_test=# 
  1. 非oracle兼容模式
lightdb@postgres=# show lightdb_dblevel_syntax_compatible_type ;
 lightdb_dblevel_syntax_compatible_type 
----------------------------------------
 off
(1 row)

lightdb@postgres=# 
lightdb@postgres=# create sequence s1 minvalue -1000000000000000000000000000;
ERROR:  value "-1000000000000000000000000000" is out of range for type bigint
lightdb@postgres=# \d+ s1
Did not find any relation named "s1".
lightdb@postgres=# 

相关推荐

  1. LightDB24.1 Sequence支持设置minvalueINT64_MIN

    2024-03-18 23:26:01       39 阅读
  2. LightDB 24.1 UNION支持null类型匹配

    2024-03-18 23:26:01       52 阅读
  3. LightDB24.1 XMLELEMENT支持省略NAME关键字

    2024-03-18 23:26:01       37 阅读
  4. LightDB24.1 oracle_fdw支持服务端GBK编码

    2024-03-18 23:26:01       49 阅读
  5. LightDB支持 no_expand hint【24.1】【oracle兼容】

    2024-03-18 23:26:01       39 阅读
  6. LightDB24.1ECPG支持EXEC ORACLE OPTION语法

    2024-03-18 23:26:01       41 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-03-18 23:26:01       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-03-18 23:26:01       100 阅读
  3. 在Django里面运行非项目文件

    2024-03-18 23:26:01       82 阅读
  4. Python语言-面向对象

    2024-03-18 23:26:01       91 阅读

热门阅读

  1. HDOJ 2061

    2024-03-18 23:26:01       40 阅读
  2. 宠物智能喂食机方案设计

    2024-03-18 23:26:01       45 阅读
  3. ROS2纯跟踪实现(C++)

    2024-03-18 23:26:01       35 阅读
  4. 英语单词--痛苦

    2024-03-18 23:26:01       37 阅读
  5. 实现C++自定义的String类

    2024-03-18 23:26:01       34 阅读
  6. Git详细入门笔记

    2024-03-18 23:26:01       28 阅读
  7. 2022 Task 2 Max Sum of 2 integers sharing first and last digits

    2024-03-18 23:26:01       38 阅读
  8. 归并排序思路

    2024-03-18 23:26:01       36 阅读
  9. 职场人如何看待领导打绩效

    2024-03-18 23:26:01       36 阅读
  10. Winform编程详解十四:NumericUpDown 数字输入框

    2024-03-18 23:26:01       42 阅读
  11. 使用Cloudflare来给wordpress网站图片自动压缩加速

    2024-03-18 23:26:01       36 阅读