firebird_fdw

Foreign data wrapper for Firebird

Overview

PackageVersionCategoryLicenseLanguage
firebird_fdw1.4.1FDWPostgreSQLC
IDExtensionBinLibLoadCreateTrustRelocSchema
8750firebird_fdwNoYesNoYesNoYes-
Relatedmysql_fdw oracle_fdw tds_fdw db2_fdw wrappers odbc_fdw jdbc_fdw postgres_fdw

pg18 breaks

Version

TypeRepoVersionPG VerPackageDeps
EXTPIGSTY1.4.11817161514firebird_fdw-
RPMPIGSTY1.4.11817161514firebird_fdw_$vlibfq
DEBPIGSTY1.4.11817161514postgresql-$v-firebird-fdwlibfq
OS / PGPG18PG17PG16PG15PG14
el8.x86_64
el8.aarch64
el9.x86_64
el9.aarch64
el10.x86_64PIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISS
el10.aarch64PIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISSPIGSTY MISS
d12.x86_64
d12.aarch64
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
d13.x86_64
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
d13.aarch64
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
u22.x86_64
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
u22.aarch64
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
u24.x86_64
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
u24.aarch64
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1
PIGSTY 1.4.1

Build

You can build the RPM / DEB packages for firebird_fdw using pig build:

pig build pkg firebird_fdw         # build RPM / DEB packages

Install

You can install firebird_fdw directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:

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

Install the extension using pig or apt/yum/dnf:

pig install firebird_fdw;          # Install for current active PG version
pig ext install -y firebird_fdw -v 18  # PG 18
pig ext install -y firebird_fdw -v 17  # PG 17
pig ext install -y firebird_fdw -v 16  # PG 16
pig ext install -y firebird_fdw -v 15  # PG 15
pig ext install -y firebird_fdw -v 14  # PG 14
dnf install -y firebird_fdw_18       # PG 18
dnf install -y firebird_fdw_17       # PG 17
dnf install -y firebird_fdw_16       # PG 16
dnf install -y firebird_fdw_15       # PG 15
dnf install -y firebird_fdw_14       # PG 14
apt install -y postgresql-18-firebird-fdw   # PG 18
apt install -y postgresql-17-firebird-fdw   # PG 17
apt install -y postgresql-16-firebird-fdw   # PG 16
apt install -y postgresql-15-firebird-fdw   # PG 15
apt install -y postgresql-14-firebird-fdw   # PG 14

Create Extension:

CREATE EXTENSION firebird_fdw;

Usage

firebird_fdw: Foreign data wrapper for Firebird

Create Server

CREATE EXTENSION firebird_fdw;

CREATE SERVER firebird_server FOREIGN DATA WRAPPER firebird_fdw
  OPTIONS (address 'localhost', database '/path/to/database.fdb');

Server Options: address (default localhost), port (default 3050), database (required, path to Firebird database file), updatable (default true), disable_pushdowns (disable WHERE clause pushdown), quote_identifiers, implicit_bool_type (enable integer-to-boolean conversion), batch_size (PostgreSQL 14+).

Create User Mapping

CREATE USER MAPPING FOR CURRENT_USER SERVER firebird_server
  OPTIONS (username 'sysdba', password 'masterke');

Create Foreign Table

CREATE FOREIGN TABLE fb_test (
  id smallint,
  val varchar(2048)
)
SERVER firebird_server
OPTIONS (table_name 'fdw_test');

With column name mapping:

CREATE FOREIGN TABLE fb_mapped (
  id smallint OPTIONS (column_name 'test_id'),
  val varchar(2048) OPTIONS (column_name 'test_val')
)
SERVER firebird_server
OPTIONS (table_name 'fdw_test');

With a custom query (read-only):

CREATE FOREIGN TABLE fb_query (
  id smallint,
  val varchar(2048)
)
SERVER firebird_server
OPTIONS (query $$ SELECT id, val FROM fdw_test WHERE id > 10 $$);

Table Options: table_name, query (mutually exclusive with table_name, read-only), updatable, estimated_row_count, quote_identifier, batch_size.

Column Options: column_name, quote_identifier, implicit_bool_type.

Import Foreign Schema

IMPORT FOREIGN SCHEMA someschema
  FROM SERVER firebird_server
  INTO public
  OPTIONS (import_views 'true', verbose 'true');

Import Options: import_not_null (default true), import_views (default true), updatable, verbose.

The schema parameter has no particular meaning in Firebird and can be set to any value.

CRUD Operations

SELECT * FROM fb_test WHERE id > 5;
INSERT INTO fb_test VALUES (10, 'new record');
UPDATE fb_test SET val = 'updated' WHERE id = 10;
DELETE FROM fb_test WHERE id = 10;

Last Modified 2026-03-12: add pg extension catalog (95749bf)