摘要:背景 Oracle 中支持很多种分区管理操作。其中 merge partitions 会将多个连续分区合并成一个分区。lightdb 24.1 中支持了该功能。 merge partitions 功能支持 list 和 range 分区,不支持 hash 分区。 用例 range 分区 CREATE
阅读全文
摘要:背景 Oracle 的 Raw 类型可以进行位操作,在 lightdb 24.1 中,对其中的函数:bit_and, bit_or, bit_xor, bit_complement 四个函数进行了改进:这些函数有了 strict 属性,即输入参数如果有 null, 则直接返回 null。 用例 bi
阅读全文
摘要:SQL CREATE TABLE measurement ( city_id int not null, logdate date not null, data text ) PARTITION BY RANGE (logdate); CREATE TABLE p1 PARTITION OF mea
阅读全文
摘要:Overview In this article, I will inspect the postgresql code to find out the implementation of alter table command, specifically, the add column subco
阅读全文
摘要:背景 Oracle 的 timestamp_to_scn 函数能根据时间戳返回一个 SCN(System Change Number). scn 与事务有关,当系统有事务提交后,最新的 scn 就会变更成一个更大的值。 ORA_ROWSCN 在 Oracle 中记录了每一行提交后的 scn. 在 L
阅读全文
摘要:The SQL select xmin::text::int8; grammar a_expr: a_expr TYPECAST Typename { $$ = makeTypeCast($1, $3, @2); } static Node * makeTypeCast(Node *arg, Typ
阅读全文
摘要:开启行级别改变记录 create table foo3(a int) rowdependencies; 插入数据 insert into foo3 values (1); insert into foo3 values (2); -- 结果为 null select ora_rowscn from
阅读全文
摘要:
阅读全文
摘要:背景 Oracle 的 create view 语句可以带有 WITH READ ONLY 选项。为了使 Oracle 的 sql 代码更方便迁移到 LightDB 中,24.1 版本中新增了 WITH READ ONLY 语法。目前用户不能在只读视图上执行 update/insert 操作更新基表
阅读全文
摘要:背景 lightdb 为兼容 Oracle 的存储过程创建了 plorsql 核心插件。在 lightdb 23.4 及之前版本,plorasql 存储过程只支持基本的语法校验(check_function_bodies = on 时)。从 lightdb 24.1 版本开始,lightdb 新增
阅读全文
摘要:based on postgres commit b96115acb8a0e08a46877c2b8ef2a7b5560b371b The SQL CREATE OR REPLACE FUNCTION demo_fors() RETURNS VOID AS $$ DECLARE a RECORD;
阅读全文
摘要:postgre version 17(commit hash: a17aa50d67bad4ee39a94988c679d2c2fed0e934) The SQL CREATE FUNCTION process_orders() RETURNS void AS $$ DECLARE c record
阅读全文
摘要:背景 在 Mysql 的建表语法中,用户可以使用 index 关键字指定列名作为索引。在 LightDB 24.1 中支持了该语法的部分特性。 用例 -- use default index name create table foo(a int, index (a)); -- create uni
阅读全文
摘要:背景 在 Oracle 中,>=, <=, !=, <> 操作符字符之间允许存在空格。为兼容这种特性,LightDB 24.1 中对这些比较操作符作了特殊处理。 用例 select count(*) from dual where 1 > = 1; select count(*) from dual
阅读全文
摘要:背景 在 Oracle 中,用户自定义的无参函数可以不带括号执行。为支持该特性,LightDB 24.1 版本中,允许用户使用无参函数的函数名调用函数,包括系统函数,如:now. 此功能限制在 LightDB 的 oracle 数据库下运行。 用例 create function fn_nopara
阅读全文
摘要:背景 在 Oracle 和 PostgreSQL 中 datetime 标识符并没有作为关键字,也不是数据类型。在 Mysql 中,datetime 是数据类型名,但并不是保留关键字。在 LightDB 23.4 及以前版本中,datetime 被误当成可以作为列名的关键字,导致 Oracle 用户
阅读全文
摘要:what is ‘query jumbling’? SUMMARY: it’s a mechanism for calculating query id. DETAIL: PostgreSQL extracts the node->type of each Node in the raw query
阅读全文
摘要:setup In the section of C declarations within the file src/backend/parser/gram.y, include the following code, #ifdef YYDEBUG #undef YYDEBUG #endif #de
阅读全文
摘要:背景 在 Oracle 中,长度为 0 的字符串被视为 NULL. 下文中长度为 0 的字符串被称为 EMPTY_STRING. 而 PostgreSQL 能够区别对待 EMPTY_STRING 和 NULL. 为了兼容 Oracle 的行为,在 LightDB 23.4 版本前,已经基本将 EMP
阅读全文
摘要:previous article: Function Candidates Selection Algorithm Problem Description function actual arguments and cadidates T = (193341, 23, 23) C = [(19334
阅读全文