jdbc_fdw
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
jdbc_fdw | 1.2 | FDW | PostgreSQL | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 8530 | jdbc_fdw | No | Yes | No | Yes | No | Yes | - |
Package/source version 0.5.0; SQL extension version 1.2. PIGSTY RPM and DEB packages cover PostgreSQL 14-18 on x86_64 and aarch64; PGDG RPM 0.4.0 is a legacy alternative for PostgreSQL 14-16. Live queries require a JDBC driver and remote database.
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | MIXED | 1.2 | 1817161514 | jdbc_fdw | - |
| RPM | PIGSTY | 0.5.0 | 1817161514 | jdbc_fdw_$v | java-11-openjdk-headless |
| DEB | PIGSTY | 0.5.0 | 1817161514 | postgresql-$v-jdbc-fdw | default-jre-headless, libpq5 |
Build
You can build the DEB packages for jdbc_fdw using pig build:
Install
You can install jdbc_fdw directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Create Extension:
Usage
Sources:
jdbc_fdw exposes a JDBC data source as PostgreSQL foreign tables and can execute remote SQL through a helper function. Use it when a suitable JDBC driver exists but no more specialized FDW is available; the JVM, driver JAR, credentials, and remote query behavior all run inside a PostgreSQL backend process.
Core Workflow
There are no table-level options in v0.5.0. Foreign columns map by name. Mark the remote primary-key column with OPTIONS (key 'true') when UPDATE or DELETE needs row identity.
Import and Direct SQL
The upstream README says IMPORT FOREIGN SCHEMA currently works only with GridDB. jdbc_exec returns record, so queries returning columns require a column definition list.
Important Options and Limits
- Server options: required
drivernameandurl, absolutejarfile, plusquerytimeoutand JVMmaxheapsize. - User-mapping options:
usernameandpassword. - Column option:
key = trueidentifies primary-key columns for writable operations. jdbc_exec(connname, sql)executes driver-specific SQL and can return a defined record set.
Version 0.5.0 supports predicate, column, and aggregate pushdown according to the upstream project, but not remote RETURNING, GROUP BY, ORDER BY, casts, or transaction-control statements. Arrays and foreign-table TRUNCATE are not implemented. Test type conversion and write semantics with the selected driver.
Protect JAR paths and server definitions from untrusted users, keep passwords in user mappings, and bound the JVM heap and remote query time. The source/package release is 0.5.0 while jdbc_fdw.control continues to declare SQL extension version 1.2; use pg_extension.extversion rather than assuming those version spaces are identical.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)