跳转到主要内容

db2fce

为 PostgreSQL 提供 DB2 兼容函数、类型、操作符与 SYSIBM.SYSDUMMY1。

db2fce · 为 PostgreSQL 提供 DB2 兼容函数、类型、操作符与 SYSIBM.SYSDUMMY1。

概览

ID扩展软件包版本类别许可证编程语言
9200db2fcedb2fce0.0.17SIMPostgreSQLSQL
属性可执行文件动态库需要预加载需要建扩展可迁移可信
----d--否否否是否否
PGDG APT is complete for PG14-18; Pigsty RPM noarch spec fills the PGDG YUM gap for PG14-18.

软件包

类型仓库版本兼容的 PostgreSQL 大版本包名模式依赖
EXTMIXED0.0.1719 18 17 16 15db2fceplpgsql
RPMPIGSTY0.0.1719 18 17 16 15db2fce_$v-
DEBPGDG0.0.1719 18 17 16 15postgresql-$v-db2fce-
Linux / PGPG19PG18PG17PG16PG15
el8.x86_64N/APIGSTY 0.0.17PIGSTY 0.0.17PIGSTY 0.0.17PIGSTY 0.0.17
el8.aarch64N/APIGSTY 0.0.17PIGSTY 0.0.17PIGSTY 0.0.17PIGSTY 0.0.17
el9.x86_64PIGSTY 0.0.17PIGSTY 0.0.17PIGSTY 0.0.17PIGSTY 0.0.17PIGSTY 0.0.17
el9.aarch64PIGSTY 0.0.17PIGSTY 0.0.17PIGSTY 0.0.17PIGSTY 0.0.17PIGSTY 0.0.17
el10.x86_64PIGSTY 0.0.17PIGSTY 0.0.17PIGSTY 0.0.17PIGSTY 0.0.17PIGSTY 0.0.17
el10.aarch64PIGSTY 0.0.17PIGSTY 0.0.17PIGSTY 0.0.17PIGSTY 0.0.17PIGSTY 0.0.17
d12.x86_64PIGSTY 0.0.17PGDG 0.0.17PGDG 0.0.17PGDG 0.0.17PGDG 0.0.17
d12.aarch64PIGSTY 0.0.17PGDG 0.0.17PGDG 0.0.17PGDG 0.0.17PGDG 0.0.17
d13.x86_64PIGSTY 0.0.17PGDG 0.0.17PGDG 0.0.17PGDG 0.0.17PGDG 0.0.17
d13.aarch64PIGSTY 0.0.17PGDG 0.0.17PGDG 0.0.17PGDG 0.0.17PGDG 0.0.17
u22.x86_64PIGSTY 0.0.17PGDG 0.0.17PGDG 0.0.17PGDG 0.0.17PGDG 0.0.17
u22.aarch64PIGSTY 0.0.17PGDG 0.0.17PGDG 0.0.17PGDG 0.0.17PGDG 0.0.17
u24.x86_64PIGSTY 0.0.17PGDG 0.0.17PGDG 0.0.17PGDG 0.0.17PGDG 0.0.17
u24.aarch64PIGSTY 0.0.17PGDG 0.0.17PGDG 0.0.17PGDG 0.0.17PGDG 0.0.17
u26.x86_64PIGSTY 0.0.17PGDG 0.0.17PGDG 0.0.17PGDG 0.0.17PGDG 0.0.17
u26.aarch64PIGSTY 0.0.17PGDG 0.0.17PGDG 0.0.17PGDG 0.0.17PGDG 0.0.17
软件包版本平台仓库大小下载
db2fce_190.0.17el9.x86_64pigsty17.4 KiBdb2fce_19-0.0.17-1PGSTY.el9.noarch.rpm
db2fce_190.0.17el9.aarch64pigsty17.4 KiBdb2fce_19-0.0.17-1PGSTY.el9.noarch.rpm
db2fce_190.0.17el10.x86_64pigsty17.5 KiBdb2fce_19-0.0.17-1PGSTY.el10.noarch.rpm
db2fce_190.0.17el10.aarch64pigsty17.5 KiBdb2fce_19-0.0.17-1PGSTY.el10.noarch.rpm
postgresql-19-db2fce0.0.17d12.x86_64pigsty9.0 KiBpostgresql-19-db2fce_0.0.17-1PGSTY~bookworm_all.deb
postgresql-19-db2fce0.0.17d12.aarch64pigsty9.0 KiBpostgresql-19-db2fce_0.0.17-1PGSTY~bookworm_all.deb
postgresql-19-db2fce0.0.17d13.x86_64pigsty9.0 KiBpostgresql-19-db2fce_0.0.17-1PGSTY~trixie_all.deb
postgresql-19-db2fce0.0.17d13.aarch64pigsty9.0 KiBpostgresql-19-db2fce_0.0.17-1PGSTY~trixie_all.deb
postgresql-19-db2fce0.0.17u22.x86_64pigsty9.1 KiBpostgresql-19-db2fce_0.0.17-1PGSTY~jammy_all.deb
postgresql-19-db2fce0.0.17u22.aarch64pigsty9.1 KiBpostgresql-19-db2fce_0.0.17-1PGSTY~jammy_all.deb
postgresql-19-db2fce0.0.17u24.x86_64pigsty9.1 KiBpostgresql-19-db2fce_0.0.17-1PGSTY~noble_all.deb
postgresql-19-db2fce0.0.17u24.aarch64pigsty9.1 KiBpostgresql-19-db2fce_0.0.17-1PGSTY~noble_all.deb
postgresql-19-db2fce0.0.17u26.x86_64pigsty9.1 KiBpostgresql-19-db2fce_0.0.17-1PGSTY~resolute_all.deb
postgresql-19-db2fce0.0.17u26.aarch64pigsty9.1 KiBpostgresql-19-db2fce_0.0.17-1PGSTY~resolute_all.deb
软件包版本平台仓库大小下载
db2fce_180.0.17el8.x86_64pigsty17.5 KiBdb2fce_18-0.0.17-1PGSTY.el8.noarch.rpm
db2fce_180.0.17el8.aarch64pigsty17.5 KiBdb2fce_18-0.0.17-1PGSTY.el8.noarch.rpm
db2fce_180.0.17el9.x86_64pigsty17.4 KiBdb2fce_18-0.0.17-1PGSTY.el9.noarch.rpm
db2fce_180.0.17el9.aarch64pigsty17.4 KiBdb2fce_18-0.0.17-1PGSTY.el9.noarch.rpm
db2fce_180.0.17el10.x86_64pigsty17.5 KiBdb2fce_18-0.0.17-1PGSTY.el10.noarch.rpm
db2fce_180.0.17el10.aarch64pigsty17.5 KiBdb2fce_18-0.0.17-1PGSTY.el10.noarch.rpm
postgresql-18-db2fce0.0.17d12.x86_64pgdg8.3 KiBpostgresql-18-db2fce_0.0.17-1.pgdg12+2_all.deb
postgresql-18-db2fce0.0.17d12.x86_64pgdg8.3 KiBpostgresql-18-db2fce_0.0.17-1.pgdg12+1_all.deb
postgresql-18-db2fce0.0.17d12.aarch64pgdg8.3 KiBpostgresql-18-db2fce_0.0.17-1.pgdg12+2_all.deb
postgresql-18-db2fce0.0.17d12.aarch64pgdg8.3 KiBpostgresql-18-db2fce_0.0.17-1.pgdg12+1_all.deb
postgresql-18-db2fce0.0.17d13.x86_64pgdg8.3 KiBpostgresql-18-db2fce_0.0.17-1.pgdg13+2_all.deb
postgresql-18-db2fce0.0.17d13.x86_64pgdg8.3 KiBpostgresql-18-db2fce_0.0.17-1.pgdg13+1_all.deb
postgresql-18-db2fce0.0.17d13.aarch64pgdg8.3 KiBpostgresql-18-db2fce_0.0.17-1.pgdg13+2_all.deb
postgresql-18-db2fce0.0.17d13.aarch64pgdg8.3 KiBpostgresql-18-db2fce_0.0.17-1.pgdg13+1_all.deb
postgresql-18-db2fce0.0.17u22.x86_64pgdg8.3 KiBpostgresql-18-db2fce_0.0.17-1.pgdg22.04+2_all.deb
postgresql-18-db2fce0.0.17u22.x86_64pgdg8.3 KiBpostgresql-18-db2fce_0.0.17-1.pgdg22.04+1_all.deb
postgresql-18-db2fce0.0.17u22.aarch64pgdg8.3 KiBpostgresql-18-db2fce_0.0.17-1.pgdg22.04+2_all.deb
postgresql-18-db2fce0.0.17u22.aarch64pgdg8.3 KiBpostgresql-18-db2fce_0.0.17-1.pgdg22.04+1_all.deb
postgresql-18-db2fce0.0.17u24.x86_64pgdg8.3 KiBpostgresql-18-db2fce_0.0.17-1.pgdg24.04+2_all.deb
postgresql-18-db2fce0.0.17u24.x86_64pgdg8.3 KiBpostgresql-18-db2fce_0.0.17-1.pgdg24.04+1_all.deb
postgresql-18-db2fce0.0.17u24.aarch64pgdg8.3 KiBpostgresql-18-db2fce_0.0.17-1.pgdg24.04+2_all.deb
postgresql-18-db2fce0.0.17u24.aarch64pgdg8.3 KiBpostgresql-18-db2fce_0.0.17-1.pgdg24.04+1_all.deb
postgresql-18-db2fce0.0.17u26.x86_64pgdg8.3 KiBpostgresql-18-db2fce_0.0.17-1.pgdg26.04+2_all.deb
postgresql-18-db2fce0.0.17u26.x86_64pgdg8.3 KiBpostgresql-18-db2fce_0.0.17-1.pgdg26.04+1_all.deb
postgresql-18-db2fce0.0.17u26.aarch64pgdg8.3 KiBpostgresql-18-db2fce_0.0.17-1.pgdg26.04+2_all.deb
postgresql-18-db2fce0.0.17u26.aarch64pgdg8.3 KiBpostgresql-18-db2fce_0.0.17-1.pgdg26.04+1_all.deb
软件包版本平台仓库大小下载
db2fce_170.0.17el8.x86_64pigsty17.5 KiBdb2fce_17-0.0.17-1PGSTY.el8.noarch.rpm
db2fce_170.0.17el8.aarch64pigsty17.5 KiBdb2fce_17-0.0.17-1PGSTY.el8.noarch.rpm
db2fce_170.0.17el9.x86_64pigsty17.4 KiBdb2fce_17-0.0.17-1PGSTY.el9.noarch.rpm
db2fce_170.0.17el9.aarch64pigsty17.4 KiBdb2fce_17-0.0.17-1PGSTY.el9.noarch.rpm
db2fce_170.0.17el10.x86_64pigsty17.5 KiBdb2fce_17-0.0.17-1PGSTY.el10.noarch.rpm
db2fce_170.0.17el10.aarch64pigsty17.5 KiBdb2fce_17-0.0.17-1PGSTY.el10.noarch.rpm
postgresql-17-db2fce0.0.17d12.x86_64pgdg8.3 KiBpostgresql-17-db2fce_0.0.17-1.pgdg12+2_all.deb
postgresql-17-db2fce0.0.17d12.x86_64pgdg8.3 KiBpostgresql-17-db2fce_0.0.17-1.pgdg12+1_all.deb
postgresql-17-db2fce0.0.17d12.aarch64pgdg8.3 KiBpostgresql-17-db2fce_0.0.17-1.pgdg12+2_all.deb
postgresql-17-db2fce0.0.17d12.aarch64pgdg8.3 KiBpostgresql-17-db2fce_0.0.17-1.pgdg12+1_all.deb
postgresql-17-db2fce0.0.17d13.x86_64pgdg8.3 KiBpostgresql-17-db2fce_0.0.17-1.pgdg13+2_all.deb
postgresql-17-db2fce0.0.17d13.x86_64pgdg8.3 KiBpostgresql-17-db2fce_0.0.17-1.pgdg13+1_all.deb
postgresql-17-db2fce0.0.17d13.aarch64pgdg8.3 KiBpostgresql-17-db2fce_0.0.17-1.pgdg13+2_all.deb
postgresql-17-db2fce0.0.17d13.aarch64pgdg8.3 KiBpostgresql-17-db2fce_0.0.17-1.pgdg13+1_all.deb
postgresql-17-db2fce0.0.17u22.x86_64pgdg8.3 KiBpostgresql-17-db2fce_0.0.17-1.pgdg22.04+2_all.deb
postgresql-17-db2fce0.0.17u22.x86_64pgdg8.3 KiBpostgresql-17-db2fce_0.0.17-1.pgdg22.04+1_all.deb
postgresql-17-db2fce0.0.17u22.aarch64pgdg8.3 KiBpostgresql-17-db2fce_0.0.17-1.pgdg22.04+2_all.deb
postgresql-17-db2fce0.0.17u22.aarch64pgdg8.3 KiBpostgresql-17-db2fce_0.0.17-1.pgdg22.04+1_all.deb
postgresql-17-db2fce0.0.17u24.x86_64pgdg8.3 KiBpostgresql-17-db2fce_0.0.17-1.pgdg24.04+2_all.deb
postgresql-17-db2fce0.0.17u24.x86_64pgdg8.3 KiBpostgresql-17-db2fce_0.0.17-1.pgdg24.04+1_all.deb
postgresql-17-db2fce0.0.17u24.aarch64pgdg8.3 KiBpostgresql-17-db2fce_0.0.17-1.pgdg24.04+2_all.deb
postgresql-17-db2fce0.0.17u24.aarch64pgdg8.3 KiBpostgresql-17-db2fce_0.0.17-1.pgdg24.04+1_all.deb
postgresql-17-db2fce0.0.17u26.x86_64pgdg8.3 KiBpostgresql-17-db2fce_0.0.17-1.pgdg26.04+2_all.deb
postgresql-17-db2fce0.0.17u26.x86_64pgdg8.3 KiBpostgresql-17-db2fce_0.0.17-1.pgdg26.04+1_all.deb
postgresql-17-db2fce0.0.17u26.aarch64pgdg8.3 KiBpostgresql-17-db2fce_0.0.17-1.pgdg26.04+2_all.deb
postgresql-17-db2fce0.0.17u26.aarch64pgdg8.3 KiBpostgresql-17-db2fce_0.0.17-1.pgdg26.04+1_all.deb
软件包版本平台仓库大小下载
db2fce_160.0.17el8.x86_64pigsty17.5 KiBdb2fce_16-0.0.17-1PGSTY.el8.noarch.rpm
db2fce_160.0.17el8.aarch64pigsty17.5 KiBdb2fce_16-0.0.17-1PGSTY.el8.noarch.rpm
db2fce_160.0.17el9.x86_64pigsty17.4 KiBdb2fce_16-0.0.17-1PGSTY.el9.noarch.rpm
db2fce_160.0.17el9.aarch64pigsty17.4 KiBdb2fce_16-0.0.17-1PGSTY.el9.noarch.rpm
db2fce_160.0.17el10.x86_64pigsty17.5 KiBdb2fce_16-0.0.17-1PGSTY.el10.noarch.rpm
db2fce_160.0.17el10.aarch64pigsty17.5 KiBdb2fce_16-0.0.17-1PGSTY.el10.noarch.rpm
postgresql-16-db2fce0.0.17d12.x86_64pgdg8.3 KiBpostgresql-16-db2fce_0.0.17-1.pgdg12+2_all.deb
postgresql-16-db2fce0.0.17d12.x86_64pgdg8.3 KiBpostgresql-16-db2fce_0.0.17-1.pgdg12+1_all.deb
postgresql-16-db2fce0.0.17d12.aarch64pgdg8.3 KiBpostgresql-16-db2fce_0.0.17-1.pgdg12+2_all.deb
postgresql-16-db2fce0.0.17d12.aarch64pgdg8.3 KiBpostgresql-16-db2fce_0.0.17-1.pgdg12+1_all.deb
postgresql-16-db2fce0.0.17d13.x86_64pgdg8.3 KiBpostgresql-16-db2fce_0.0.17-1.pgdg13+2_all.deb
postgresql-16-db2fce0.0.17d13.x86_64pgdg8.3 KiBpostgresql-16-db2fce_0.0.17-1.pgdg13+1_all.deb
postgresql-16-db2fce0.0.17d13.aarch64pgdg8.3 KiBpostgresql-16-db2fce_0.0.17-1.pgdg13+2_all.deb
postgresql-16-db2fce0.0.17d13.aarch64pgdg8.3 KiBpostgresql-16-db2fce_0.0.17-1.pgdg13+1_all.deb
postgresql-16-db2fce0.0.17u22.x86_64pgdg8.3 KiBpostgresql-16-db2fce_0.0.17-1.pgdg22.04+2_all.deb
postgresql-16-db2fce0.0.17u22.x86_64pgdg8.3 KiBpostgresql-16-db2fce_0.0.17-1.pgdg22.04+1_all.deb
postgresql-16-db2fce0.0.17u22.aarch64pgdg8.3 KiBpostgresql-16-db2fce_0.0.17-1.pgdg22.04+2_all.deb
postgresql-16-db2fce0.0.17u22.aarch64pgdg8.3 KiBpostgresql-16-db2fce_0.0.17-1.pgdg22.04+1_all.deb
postgresql-16-db2fce0.0.17u24.x86_64pgdg8.3 KiBpostgresql-16-db2fce_0.0.17-1.pgdg24.04+2_all.deb
postgresql-16-db2fce0.0.17u24.x86_64pgdg8.3 KiBpostgresql-16-db2fce_0.0.17-1.pgdg24.04+1_all.deb
postgresql-16-db2fce0.0.17u24.aarch64pgdg8.3 KiBpostgresql-16-db2fce_0.0.17-1.pgdg24.04+2_all.deb
postgresql-16-db2fce0.0.17u24.aarch64pgdg8.3 KiBpostgresql-16-db2fce_0.0.17-1.pgdg24.04+1_all.deb
postgresql-16-db2fce0.0.17u26.x86_64pgdg8.3 KiBpostgresql-16-db2fce_0.0.17-1.pgdg26.04+2_all.deb
postgresql-16-db2fce0.0.17u26.x86_64pgdg8.3 KiBpostgresql-16-db2fce_0.0.17-1.pgdg26.04+1_all.deb
postgresql-16-db2fce0.0.17u26.aarch64pgdg8.3 KiBpostgresql-16-db2fce_0.0.17-1.pgdg26.04+2_all.deb
postgresql-16-db2fce0.0.17u26.aarch64pgdg8.3 KiBpostgresql-16-db2fce_0.0.17-1.pgdg26.04+1_all.deb
软件包版本平台仓库大小下载
db2fce_150.0.17el8.x86_64pigsty17.5 KiBdb2fce_15-0.0.17-1PGSTY.el8.noarch.rpm
db2fce_150.0.17el8.aarch64pigsty17.5 KiBdb2fce_15-0.0.17-1PGSTY.el8.noarch.rpm
db2fce_150.0.17el9.x86_64pigsty17.4 KiBdb2fce_15-0.0.17-1PGSTY.el9.noarch.rpm
db2fce_150.0.17el9.aarch64pigsty17.4 KiBdb2fce_15-0.0.17-1PGSTY.el9.noarch.rpm
db2fce_150.0.17el10.x86_64pigsty17.5 KiBdb2fce_15-0.0.17-1PGSTY.el10.noarch.rpm
db2fce_150.0.17el10.aarch64pigsty17.5 KiBdb2fce_15-0.0.17-1PGSTY.el10.noarch.rpm
postgresql-15-db2fce0.0.17d12.x86_64pgdg8.3 KiBpostgresql-15-db2fce_0.0.17-1.pgdg12+2_all.deb
postgresql-15-db2fce0.0.17d12.x86_64pgdg8.3 KiBpostgresql-15-db2fce_0.0.17-1.pgdg12+1_all.deb
postgresql-15-db2fce0.0.17d12.aarch64pgdg8.3 KiBpostgresql-15-db2fce_0.0.17-1.pgdg12+2_all.deb
postgresql-15-db2fce0.0.17d12.aarch64pgdg8.3 KiBpostgresql-15-db2fce_0.0.17-1.pgdg12+1_all.deb
postgresql-15-db2fce0.0.17d13.x86_64pgdg8.3 KiBpostgresql-15-db2fce_0.0.17-1.pgdg13+2_all.deb
postgresql-15-db2fce0.0.17d13.x86_64pgdg8.3 KiBpostgresql-15-db2fce_0.0.17-1.pgdg13+1_all.deb
postgresql-15-db2fce0.0.17d13.aarch64pgdg8.3 KiBpostgresql-15-db2fce_0.0.17-1.pgdg13+2_all.deb
postgresql-15-db2fce0.0.17d13.aarch64pgdg8.3 KiBpostgresql-15-db2fce_0.0.17-1.pgdg13+1_all.deb
postgresql-15-db2fce0.0.17u22.x86_64pgdg8.3 KiBpostgresql-15-db2fce_0.0.17-1.pgdg22.04+2_all.deb
postgresql-15-db2fce0.0.17u22.x86_64pgdg8.3 KiBpostgresql-15-db2fce_0.0.17-1.pgdg22.04+1_all.deb
postgresql-15-db2fce0.0.17u22.aarch64pgdg8.3 KiBpostgresql-15-db2fce_0.0.17-1.pgdg22.04+2_all.deb
postgresql-15-db2fce0.0.17u22.aarch64pgdg8.3 KiBpostgresql-15-db2fce_0.0.17-1.pgdg22.04+1_all.deb
postgresql-15-db2fce0.0.17u24.x86_64pgdg8.3 KiBpostgresql-15-db2fce_0.0.17-1.pgdg24.04+2_all.deb
postgresql-15-db2fce0.0.17u24.x86_64pgdg8.3 KiBpostgresql-15-db2fce_0.0.17-1.pgdg24.04+1_all.deb
postgresql-15-db2fce0.0.17u24.aarch64pgdg8.3 KiBpostgresql-15-db2fce_0.0.17-1.pgdg24.04+2_all.deb
postgresql-15-db2fce0.0.17u24.aarch64pgdg8.3 KiBpostgresql-15-db2fce_0.0.17-1.pgdg24.04+1_all.deb
postgresql-15-db2fce0.0.17u26.x86_64pgdg8.3 KiBpostgresql-15-db2fce_0.0.17-1.pgdg26.04+2_all.deb
postgresql-15-db2fce0.0.17u26.x86_64pgdg8.3 KiBpostgresql-15-db2fce_0.0.17-1.pgdg26.04+1_all.deb
postgresql-15-db2fce0.0.17u26.aarch64pgdg8.3 KiBpostgresql-15-db2fce_0.0.17-1.pgdg26.04+2_all.deb
postgresql-15-db2fce0.0.17u26.aarch64pgdg8.3 KiBpostgresql-15-db2fce_0.0.17-1.pgdg26.04+1_all.deb

源码

pig build pkg db2fce;		# build rpm/deb

安装

启用 PGDG 和 PIGSTY 仓库并更新缓存。

pig repo add pgsql -u   # add both repo and update cache

使用 pig 安装扩展。

pig install db2fce;		# install by package name

pig install db2fce -v 19;   # install for PG 19
pig install db2fce -v 18;   # install for PG 18
pig install db2fce -v 17;   # install for PG 17
pig install db2fce -v 16;   # install for PG 16
pig install db2fce -v 15;   # install for PG 15

在数据库中创建扩展。

CREATE EXTENSION db2fce CASCADE; -- requires plpgsql

用法

来源:README,SQL objects,control file

db2fce 为 PostgreSQL 提供 DB2 兼容环境。它创建 DB2 风格的函数、类型、操作符,以及 SYSIBM.SYSDUMMY1 兼容视图,便于迁移或适配原本面向 IBM Db2 的 SQL。

启用

CREATE EXTENSION db2fce;

SET search_path = db2, sysibm, public;

大多数兼容对象位于 db2 schema,sysibm.sysdummy1 用于兼容需要 dummy 单行表的 DB2 查询。

SELECT * FROM sysibm.sysdummy1;

兼容函数

db2 schema 包含日期时间函数,例如 microsecond、second、minute、hour、day、month、year、days、months_between、date、time、timestamp_format。

字符串和转换函数包括 locate、translate、lcase、upper、lower、strip、char、integer、int、double、decimal、dec、hex、round、digits、value。

操作符

SQL 层还定义了 DB2 风格操作符,例如用于不等比较的 ^=,以及多种类型上的拼接操作符 !!。

SELECT db2.int('42');
SELECT db2.days(current_date);
SELECT 'db' !! '2';

注意事项

把 db2 加入 search_path 后,很多 DB2 函数调用可以不带 schema 前缀。部分与 PostgreSQL 语法或内置行为冲突的名称,仍然需要显式写成 db2. 前缀。

表格阅读器