暂无图片
暂无图片
2
暂无图片
暂无图片
暂无图片

opengauss 兼容性之于postgreSQL(开发)

原创 飞鸟-柯 2023-01-05
3126
差异父类 差异子类 详情(PG 12.0) 详情(opengauss 3.0) 是否可以兼容 实现方式
字符集和排序规则 字符集 UTF-8,GBK,latin1-10,GB18030,SQL ASCII GBK、GB18030、UTF-8、SQL ASCII,Latin-1  
排序规则 en_GB.UTF8,ja_JP.UTF8,fi_FI.UTF8
select pg_encoding_to_char(collencoding) as encoding,collname,collcollate,collctype from pg_collation ;
 
en_GB.UTF8,ja_JP.UTF8,fi_FI.UTF8
select pg_encoding_to_char(collencoding) as encoding,collname,collcollate,collctype from pg_collation ;
 
 
数据类型 整数类型 smallint smallint  
integer integer  
bigint bigint  
decimal[(p[,s])] decimal[(p[,s])]  
numeric[(p[,s])] numeric[(p[,s])]  
real real  
double precision double precision  
smallserial smallserial  
serial serial  
bigserial bigserial  
字符串类型 char(n) char(n)  
varchar(n) varchar(n)  
text text  
时间日期类型 timestamp[(p )][without time zone] timestamp[(p )][without time zone]  
timestamp[(p )][with time zone] timestamp[(p )][with time zone]  
date date  
time[(p )][without time zone] time[(p )][without time zone]  
time[(p )][with time zone] time[(p )][with time zone]  
interval[fields][(p )] interval[fields][(p )]  
json类型 json json  
jsonb    
货币类型 money money  
SQL语法 游标语法 支持 该功能仅在数据库兼容模式为Oracle类型和PG类型时能够使用(即创建DB时DBCOMPATIBILITY='A'或者'PG'),其他类型数据库兼容模式保持原有语法不做改动。 在Vastbase使用游标(CURSOR)语法时,仅需要在Oracle类型和PG类型语法基础上调换变量名与类型关键字的顺序即可在Vastbase中实现该功能
CREATE SEQUENCE...as data_type 支持 在PG兼容模式下,可以使用as datatype语法可选项,指定序列的数据类型。  
支持update使用where current of 支持 在PG兼容模式下,Vastbase G100支持update命令使用where current of可选子句。使用此子句可以更新游标对应的字段值。  
字符串连接符+null 支持 符串连接符+null的执行结果对标PG执行结果。  
null 与 空字符 null != ‘’ 在 openGauss 里‘’转换成 null,没有‘’ null转换为‘’
xid 32bit 64bit    
其他 索引类型 btree btree    
hash hash    
gin gin    
gist gist    
BRIN    
SP-GiST    
分区类型 hash,range,list hash,range,list,Interval,二级分区    
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论