postgres_fdw
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
postgres_fdw | 1.1 | FDW | PostgreSQL | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 8990 | postgres_fdw | No | Yes | No | Yes | No | No | - |
| Related | db_migrator pgspider_ext dblink mimeo pgclone pglogical mysql_fdw citus plproxy db2_fdw |
|---|---|
| Depended By | omni_schema |
Version
| PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|
| 1.1 | 1.1 | 1.1 | 1.1 | 1.1 |
Install
Note: This is a built-in contrib extension of PostgreSQL
Usage
postgres_fdw: Foreign data wrapper for remote PostgreSQL servers
Create Server
Server Options: Any libpq connection parameter (host, port, dbname, etc.), plus use_remote_estimate (default false), fdw_startup_cost (default 100), fdw_tuple_cost (default 0.2), extensions (comma-separated list of extensions installed on both servers), fetch_size (default 100), batch_size (default 1), keep_connections (default on), parallel_commit (default false), parallel_abort (default false).
Create User Mapping
Create Foreign Table
Table/Column Options: schema_name (default: local schema name), table_name (default: local table name), column_name (per-column, remote column name), updatable (default true), truncatable (default true), async_capable (default false).
Import Foreign Schema
Import Options: import_collate (default true), import_default (default false), import_generated (default true), import_not_null (default true).
CRUD Operations
Query Optimization
postgres_fdw automatically pushes down WHERE clauses, JOINs between tables on the same server, aggregate functions, ORDER BY, and LIMIT/OFFSET. View the remote query with:
Use the extensions option to allow function/operator pushdown from those extensions:
Asynchronous Execution
Enable concurrent scans across multiple foreign servers:
Connection Management
Transaction Behavior
Remote transactions use SERIALIZABLE if the local transaction is SERIALIZABLE; otherwise REPEATABLE READ. Two-phase commit is not currently supported.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)