postgres_fdw
postgres_fdw : foreign-data wrapper for remote PostgreSQL servers
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 8990 | postgres_fdw | postgres_fdw | 1.1 |
FDW | PostgreSQL | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-d-- | No | Yes | No | Yes | no | no |
| Relationships | |
|---|---|
| Need By | omni_schema |
| See Also | db_migrator pgspider_ext dblink mimeo pgclone pglogical mysql_fdw citus plproxy db2_fdw |
Packages
| PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|
| 1.1 | 1.1 | 1.1 | 1.1 | 1.1 |
Install
Create this extension with:
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.