标签
PostgreSQL , Oracle , 兼容性 , 18c
背景
Oracle 18c 发布了诸多新特性,其中大部分Oracle 18c的重大特性,在早期版本的PostgreSQL数据库已支持。
如下
一、开发特性
1 图式搜索
Oracle 18c
SQL-Based Property Graph Query and Analytics
PostgreSQL 8.4+ (2009 year+)
1、2009年PostgreSQL社区版本8.4,加入CTE递归语法的支持,支持图式搜索。
《PostgreSQL 图式搜索(graph search)实践 - 百亿级图谱,毫秒响应》
《PostgreSQL 实践 - 内容社区(如论坛)图式搜索应用》
《小微贷款、天使投资(风控助手)业务数据库设计(图式搜索\图谱分析) - 阿里云RDS PostgreSQL, HybridDB for PostgreSQL最佳实践》
2、2017年3月,基于PostgreSQL的专业图数据库AgensGraph发布1.0,兼容标准SQL和图式搜索语法openCypher。
AgensGraph supports ANSI-SQL and openCypher (http://www.opencypher.org).
https://github.com/bitnine-oss/agensgraph
2 JSON 增强
Oracle 18c
SQL Enhancements for JSON
支持行转JSON。
PostgreSQL 9.2+ (2012 year+)
2012年PostgreSQL社区版本9.2,加入JSON的支持。
https://www.postgresql.org/docs/current/static/datatype-json.html
9.2已支持行转JSON
row_to_json(record [, pretty_bool])
除此之外,PostgreSQL还支持嵌套JSON,K-V转JSON,K-V类型。支持数组类型,LTREE,RANGE,XML,TS,IP 等类型,对开发更加的友好。
https://www.postgresql.org/docs/devel/static/functions.html
https://www.postgresql.org/docs/devel/static/hstore.html
https://www.postgresql.org/docs/current/static/ltree.html
3 空间数据sharding
Oracle 18c
支持空间数据字段作为SHARDING字段
PostgreSQL 8.2+ (2007 year+)
1、早在2008年以前,就可以使用plproxy来实现PostgreSQL sharding,在skype内核心数据库用的就是plproxy做的sharding。sharding算法完全由用户控制,不管是空间数据还是什么数据,都可以支持。
《阿里云ApsaraDB RDS for PostgreSQL 最佳实践 - 4 水平分库 之 节点扩展》
《阿里云ApsaraDB RDS for PostgreSQL 最佳实践 - 3 水平分库 vs 单机 性能》
《阿里云ApsaraDB RDS for PostgreSQL 最佳实践 - 2 教你RDS PG的水平分库》
《PostgreSQL 最佳实践 - 水平分库(基于plproxy)》
《A Smart PostgreSQL extension plproxy 2.2 practices》
2、除了plproxy分库分表以外,PostgreSQL社区还有一些NewSQL或MPP架构的数据库或插件,例如postgres-xl, antdb, citusDB, Greenplum:
https://github.com/ADBSQL/AntDB
https://www.citusdata.com/product
https://wiki.postgresql.org/wiki/PostgreSQL_derived_databases
3、2016年发布的PostgreSQL 9.6与pg_pathman插件,支持外部表继承,同时支持外部表的查询下推,支持表达式分区。这些特性决定了用户可以使用PostgreSQL 9.6+, pg_pathman, postgis(st_geohash)来实现空间字段的sharding。