firebird_fdw
firebird_fdw : Foreign data wrapper for Firebird
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 8750 | firebird_fdw
|
firebird_fdw
|
1.4.1 |
FDW
|
PostgreSQL
|
C
|
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
--s-d-r
|
No
|
Yes
|
No
|
Yes
|
yes
|
no
|
| Relationships | |
|---|---|
| See Also | mysql_fdw
oracle_fdw
tds_fdw
db2_fdw
wrappers
odbc_fdw
jdbc_fdw
postgres_fdw
|
pg18 breaks
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY
|
1.4.1 |
18
17
16
15
14
|
firebird_fdw |
- |
| RPM | PIGSTY
|
1.4.1 |
18
17
16
15
14
|
firebird_fdw_$v |
libfq |
| DEB | PIGSTY
|
1.4.1 |
18
17
16
15
14
|
postgresql-$v-firebird-fdw |
libfq |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
el8.x86_64
|
PIGSTY 1.4.1
|
PIGSTY 1.4.1
|
PIGSTY 1.4.1
|
PIGSTY 1.4.1
|
PIGSTY 1.4.1
|
el8.aarch64
|
PIGSTY 1.4.1
|
PIGSTY 1.4.1
|
PIGSTY 1.4.1
|
PIGSTY 1.4.1
|
PIGSTY 1.4.1
|
el9.x86_64
|
PGDG 1.4.1
|
PGDG 1.4.1
|
PGDG 1.4.1
|
PGDG 1.4.1
|
PGDG 1.4.1
|
el9.aarch64
|
PGDG 1.4.1
|
PGDG 1.4.1
|
PGDG 1.4.1
|
PGDG 1.4.1
|
PGDG 1.4.1
|
el10.x86_64
|
MISS
|
MISS
|
MISS
|
MISS
|
MISS
|
el10.aarch64
|
MISS
|
MISS
|
MISS
|
MISS
|
MISS
|
d12.x86_64
|
PIGSTY 1.4.1
|
PIGSTY 1.4.1
|
PIGSTY 1.4.1
|
PIGSTY 1.4.1
|
PIGSTY 1.4.1
|
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
|
Source
pig build pkg firebird_fdw; # build rpm/debInstall
Make sure PGDG and PIGSTY repo available:
pig repo add pgsql -u # add both repo and update cacheInstall this extension with pig:
pig install firebird_fdw; # install via package name, for the active PG version
pig install firebird_fdw -v 18; # install for PG 18
pig install firebird_fdw -v 17; # install for PG 17
pig install firebird_fdw -v 16; # install for PG 16
pig install firebird_fdw -v 15; # install for PG 15
pig install firebird_fdw -v 14; # install for PG 14Create this extension with:
CREATE EXTENSION firebird_fdw;Usage
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;