Skip to content
db2fce

db2fce

db2fce : DB2 compatibility functions, types, operators, and SYSIBM.SYSDUMMY1 for PostgreSQL.

Overview

ID Extension Package Version Category License Language
9200
db2fce
db2fce
0.0.17
SIM
PostgreSQL
SQL
Attribute Has Binary Has Library Need Load Has DDL Relocatable Trusted
----d--
No
No
No
Yes
no
no
Relationships
Schemas db2 sysibm
Requires
plpgsql
See Also
orafce
pg_dbms_metadata
pg_dbms_job

PGDG APT is complete for PG14-18; Pigsty RPM noarch spec fills the PGDG YUM gap for PG14-18.

Packages

Type Repo Version PG Major Compatibility Package Pattern Dependencies
EXT
MIXED
0.0.17
18
17
16
15
14
db2fce plpgsql
RPM
PIGSTY
0.0.17
18
17
16
15
14
db2fce_$v -
DEB
PGDG
0.0.17
18
17
16
15
14
postgresql-$v-db2fce -
Linux / PG PG18 PG17 PG16 PG15 PG14
el8.x86_64
PIGSTY 0.0.17
PIGSTY 0.0.17
PIGSTY 0.0.17
PIGSTY 0.0.17
PIGSTY 0.0.17
el8.aarch64
PIGSTY 0.0.17
PIGSTY 0.0.17
PIGSTY 0.0.17
PIGSTY 0.0.17
PIGSTY 0.0.17
el9.x86_64
PIGSTY 0.0.17
PIGSTY 0.0.17
PIGSTY 0.0.17
PIGSTY 0.0.17
PIGSTY 0.0.17
el9.aarch64
PIGSTY 0.0.17
PIGSTY 0.0.17
PIGSTY 0.0.17
PIGSTY 0.0.17
PIGSTY 0.0.17
el10.x86_64
PIGSTY 0.0.17
PIGSTY 0.0.17
PIGSTY 0.0.17
PIGSTY 0.0.17
PIGSTY 0.0.17
el10.aarch64
PIGSTY 0.0.17
PIGSTY 0.0.17
PIGSTY 0.0.17
PIGSTY 0.0.17
PIGSTY 0.0.17
d12.x86_64
PGDG 0.0.17
PGDG 0.0.17
PGDG 0.0.17
PGDG 0.0.17
PGDG 0.0.17
d12.aarch64
PGDG 0.0.17
PGDG 0.0.17
PGDG 0.0.17
PGDG 0.0.17
PGDG 0.0.17
d13.x86_64
PGDG 0.0.17
PGDG 0.0.17
PGDG 0.0.17
PGDG 0.0.17
PGDG 0.0.17
d13.aarch64
PGDG 0.0.17
PGDG 0.0.17
PGDG 0.0.17
PGDG 0.0.17
PGDG 0.0.17
u22.x86_64
PGDG 0.0.17
PGDG 0.0.17
PGDG 0.0.17
PGDG 0.0.17
PGDG 0.0.17
u22.aarch64
PGDG 0.0.17
PGDG 0.0.17
PGDG 0.0.17
PGDG 0.0.17
PGDG 0.0.17
u24.x86_64
PGDG 0.0.17
PGDG 0.0.17
PGDG 0.0.17
PGDG 0.0.17
PGDG 0.0.17
u24.aarch64
PGDG 0.0.17
PGDG 0.0.17
PGDG 0.0.17
PGDG 0.0.17
PGDG 0.0.17
u26.x86_64
PGDG 0.0.17
PGDG 0.0.17
PGDG 0.0.17
PGDG 0.0.17
PGDG 0.0.17
u26.aarch64
PGDG 0.0.17
PGDG 0.0.17
PGDG 0.0.17
PGDG 0.0.17
PGDG 0.0.17
Package Version OS ORG SIZE File URL
db2fce_18 0.0.17 el8.x86_64 pigsty 17.5 KiB db2fce_18-0.0.17-1PIGSTY.el8.noarch.rpm
db2fce_18 0.0.17 el8.aarch64 pigsty 17.5 KiB db2fce_18-0.0.17-1PIGSTY.el8.noarch.rpm
db2fce_18 0.0.17 el9.x86_64 pigsty 17.4 KiB db2fce_18-0.0.17-1PIGSTY.el9.noarch.rpm
db2fce_18 0.0.17 el9.aarch64 pigsty 17.4 KiB db2fce_18-0.0.17-1PIGSTY.el9.noarch.rpm
db2fce_18 0.0.17 el10.x86_64 pigsty 17.5 KiB db2fce_18-0.0.17-1PIGSTY.el10.noarch.rpm
db2fce_18 0.0.17 el10.aarch64 pigsty 17.5 KiB db2fce_18-0.0.17-1PIGSTY.el10.noarch.rpm
postgresql-18-db2fce 0.0.17 d12.x86_64 pgdg 8.3 KiB postgresql-18-db2fce_0.0.17-1.pgdg12+1_all.deb
postgresql-18-db2fce 0.0.17 d12.aarch64 pgdg 8.3 KiB postgresql-18-db2fce_0.0.17-1.pgdg12+1_all.deb
postgresql-18-db2fce 0.0.17 d13.x86_64 pgdg 8.3 KiB postgresql-18-db2fce_0.0.17-1.pgdg13+1_all.deb
postgresql-18-db2fce 0.0.17 d13.aarch64 pgdg 8.3 KiB postgresql-18-db2fce_0.0.17-1.pgdg13+1_all.deb
postgresql-18-db2fce 0.0.17 u22.x86_64 pgdg 8.3 KiB postgresql-18-db2fce_0.0.17-1.pgdg22.04+1_all.deb
postgresql-18-db2fce 0.0.17 u22.aarch64 pgdg 8.3 KiB postgresql-18-db2fce_0.0.17-1.pgdg22.04+1_all.deb
postgresql-18-db2fce 0.0.17 u24.x86_64 pgdg 8.3 KiB postgresql-18-db2fce_0.0.17-1.pgdg24.04+1_all.deb
postgresql-18-db2fce 0.0.17 u24.aarch64 pgdg 8.3 KiB postgresql-18-db2fce_0.0.17-1.pgdg24.04+1_all.deb
postgresql-18-db2fce 0.0.17 u26.x86_64 pgdg 8.3 KiB postgresql-18-db2fce_0.0.17-1.pgdg26.04+1_all.deb
postgresql-18-db2fce 0.0.17 u26.aarch64 pgdg 8.3 KiB postgresql-18-db2fce_0.0.17-1.pgdg26.04+1_all.deb

Source

pig build pkg db2fce;		# build rpm/deb

Install

Make sure PGDG and PIGSTY repo available:

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

Install this extension with pig:

pig install db2fce;		# install via package name, for the active PG version

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
pig install db2fce -v 14;   # install for PG 14

Create this extension with:

CREATE EXTENSION db2fce CASCADE; -- requires plpgsql

Usage

Sources: README, SQL objects, control file

db2fce provides a DB2 compatibility environment for PostgreSQL. It creates DB2-style functions, types, operators, and the SYSIBM.SYSDUMMY1 compatibility view so SQL originally written for IBM Db2 can be adapted with fewer changes.

Enable

CREATE EXTENSION db2fce;

SET search_path = db2, sysibm, public;

The extension creates most compatibility objects in the db2 schema and creates sysibm.sysdummy1 for DB2 queries that expect a dummy single-row table.

SELECT * FROM sysibm.sysdummy1;

Compatibility Functions

The db2 schema includes date/time helpers such as microsecond, second, minute, hour, day, month, year, days, months_between, date, time, and timestamp_format.

String and conversion helpers include locate, translate, lcase, upper, lower, strip, char, integer, int, double, decimal, dec, hex, round, digits, and value.

Operators

The SQL layer also defines DB2-style operators such as ^= for inequality and !! for concatenation across several data types.

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

Notes

Adding db2 to search_path lets many DB2 function calls work without schema qualification. Some names that conflict with PostgreSQL syntax or built-in behavior may still need explicit db2. qualification.

Last updated on