IvorySQL

使用瀚高开源的 IvorySQL 内核,基于 PostgreSQL 集群实现 Oracle 语法/PLSQL 兼容性。

IvorySQL 是一个开源的,旨在基于 PG 提供 “Oracle兼容性” 的 PostgreSQL 内核分支。


概览

IvorySQL 内核支持在 Pigsty 开源版本中提供,您的服务器需要互联网访问,直接从 IvorySQL 的官方仓库下载相关软件包。

请注意,直接将 IvorySQL 加入 Pigsty 默认软件仓库中会影响原生 PostgreSQL 内核的安装。Pigsty 专业版提供包括 IvorySQL 内核在内的离线安装解决方案。

当前 IvorySQL 的最新版本为 3.4,对应的 PostgreSQL 版本为 16.4。请注意,IvorySQL 当前仅在 EL8/EL9 上可用。

最后一个支持 EL7 的 IvorySQL 版本为 3.3,对应 PostgreSQL 16.3


安装

如果您的环境有互联网访问,您可以使用以下方式,直接将 IvorySQL 仓库加入到节点上,然后执行 PGSQL 剧本进行安装

./node.yml -t node_repo -e '{"node_repo_modules":"local,node,pgsql,ivory"}'

配置

以下参数需要针对 IvorySQL 数据库集群进行配置:

#----------------------------------#
# Ivory SQL Configuration
#----------------------------------#
node_repo_modules: local,node,pgsql,ivory  # add ivorysql upstream repo
pg_mode: ivory                    # IvorySQL Oracle Compatible Mode
pg_packages: [ 'ivorysql patroni pgbouncer pgbackrest pg_exporter pgbadger vip-manager' ]
pg_libs: 'liboracle_parser, pg_stat_statements, auto_explain'
pg_extensions: [ ]                # do not install any vanilla postgresql extensions

使用 Oracle 兼容性模式时,需要动态加载 liboracle_parser 扩展插件。


客户端访问

IvorySQL 等效于 PostgreSQL 16,任何兼容 PostgreSQL 线缆协议的客户端工具都可以访问 IvorySQL 集群。


扩展列表

绝大多数 PGSQL 模块的 扩展插件 (非纯 SQL 类)都无法直接在 IvorySQL 内核上使用,如果需要使用,请针对新内核从源码重新编译安装。

目前 IvorySQL 内核自带了以下 101 个扩展插件。

nameversioncomment
hstore_plperl1.0transform between hstore and plperl
plisql1.0PL/iSQL procedural language
hstore_plperlu1.0transform between hstore and plperlu
adminpack2.1administrative functions for PostgreSQL
insert_username1.0functions for tracking who changed a table
dblink1.2connect to other PostgreSQL databases from within a database
dict_int1.0text search dictionary template for integers
amcheck1.3functions for verifying relation integrity
intagg1.1integer aggregator and enumerator (obsolete)
autoinc1.0functions for autoincrementing fields
bloom1.0bloom access method - signature file based index
dict_xsyn1.0text search dictionary template for extended synonym processing
btree_gin1.3support for indexing common datatypes in GIN
earthdistance1.1calculate great-circle distances on the surface of the Earth
file_fdw1.0foreign-data wrapper for flat file access
fuzzystrmatch1.2determine similarities and distance between strings
btree_gist1.7support for indexing common datatypes in GiST
intarray1.5functions, operators, and index support for 1-D arrays of integers
citext1.6data type for case-insensitive character strings
isn1.2data types for international product numbering standards
ivorysql_ora1.0Oracle Compatible extenison on Postgres Database
jsonb_plperl1.0transform between jsonb and plperl
cube1.5data type for multidimensional cubes
dummy_index_am1.0dummy_index_am - index access method template
dummy_seclabel1.0Test code for SECURITY LABEL feature
hstore1.8data type for storing sets of (key, value) pairs
jsonb_plperlu1.0transform between jsonb and plperlu
lo1.1Large Object maintenance
ltree1.2data type for hierarchical tree-like structures
moddatetime1.0functions for tracking last modification time
old_snapshot1.0utilities in support of old_snapshot_threshold
ora_btree_gin1.0support for indexing oracle datatypes in GIN
pg_trgm1.6text similarity measurement and index searching based on trigrams
ora_btree_gist1.0support for oracle indexing common datatypes in GiST
pg_visibility1.2examine the visibility map (VM) and page-level visibility info
pg_walinspect1.1functions to inspect contents of PostgreSQL Write-Ahead Log
pgcrypto1.3cryptographic functions
pgstattuple1.5show tuple-level statistics
pageinspect1.12inspect the contents of database pages at a low level
pgrowlocks1.2show row-level locking information
pg_buffercache1.4examine the shared buffer cache
pg_stat_statements1.10track planning and execution statistics of all SQL statements executed
pg_freespacemap1.2examine the free space map (FSM)
plsample1.0PL/Sample
pg_prewarm1.2prewarm relation data
pg_surgery1.0extension to perform surgery on a damaged relation
seg1.4data type for representing line segments or floating-point intervals
postgres_fdw1.1foreign-data wrapper for remote PostgreSQL servers
refint1.0functions for implementing referential integrity (obsolete)
test_ext_req_schema11.0Required extension to be referenced
spgist_name_ops1.0Test opclass for SP-GiST
test_ext_req_schema21.0Test schema referencing of required extensions
test_shm_mq1.0Test code for shared memory message queues
sslinfo1.2information about SSL certificates
test_slru1.0Test code for SLRU
tablefunc1.0functions that manipulate whole tables, including crosstab
bool_plperl1.0transform between bool and plperl
tcn1.0Triggered change notifications
test_ext_req_schema31.0Test schema referencing of 2 required extensions
test_bloomfilter1.0Test code for Bloom filter library
test_copy_callbacks1.0Test code for COPY callbacks
test_ginpostinglist1.0Test code for ginpostinglist.c
test_custom_rmgrs1.0Test code for custom WAL resource managers
test_integerset1.0Test code for integerset
test_ddl_deparse1.0Test code for DDL deparse feature
tsm_system_rows1.0TABLESAMPLE method which accepts number of rows as a limit
test_ext11.0Test extension 1
tsm_system_time1.0TABLESAMPLE method which accepts time in milliseconds as a limit
test_ext21.0Test extension 2
unaccent1.1text search dictionary that removes accents
test_ext31.0Test extension 3
test_ext41.0Test extension 4
uuid-ossp1.1generate universally unique identifiers (UUIDs)
test_ext51.0Test extension 5
worker_spi1.0Sample background worker
test_ext61.0test_ext6
test_lfind1.0Test code for optimized linear search functions
xml21.1XPath querying and XSLT
test_ext71.0Test extension 7
plpgsql1.0PL/pgSQL procedural language
test_ext81.0Test extension 8
test_parser1.0example of a custom parser for full-text search
test_pg_dump1.0Test pg_dump with an extension
test_ext_cine1.0Test extension using CREATE IF NOT EXISTS
test_predtest1.0Test code for optimizer/util/predtest.c
test_ext_cor1.0Test extension using CREATE OR REPLACE
test_rbtree1.0Test code for red-black tree library
test_ext_cyclic11.0Test extension cyclic 1
test_ext_cyclic21.0Test extension cyclic 2
test_ext_extschema1.0test @extschema@
test_regex1.0Test code for backend/regex/
test_ext_evttrig1.0Test extension - event trigger
bool_plperlu1.0transform between bool and plperlu
plperl1.0PL/Perl procedural language
plperlu1.0PL/PerlU untrusted procedural language
hstore_plpython3u1.0transform between hstore and plpython3u
jsonb_plpython3u1.0transform between jsonb and plpython3u
ltree_plpython3u1.0transform between ltree and plpython3u
plpython3u1.0PL/Python3U untrusted procedural language
pltcl1.0PL/Tcl procedural language
pltclu1.0PL/TclU untrusted procedural language

请注意,Pigsty 不对使用 IvorySQL 内核承担任何质保责任,使用此内核遇到的任何问题与需求请联系原厂解决。


最后修改 2025-12-21: update blogs (cbce062)