postgres_fdw
A foreign data wrapper for connecting PostgreSQL databases
postgres_fdw
is a foreign data wrapper provided as a contrib module for connecting PostgreSQL databases.
postgres_fdw
was added in PostgreSQL 9.3.
Source code
postgres_fdw
source is located at contrib/postgres_fdw/.
Change history
- PostgreSQL 14
- support for bulk inserts; server/table-level option
batch_size
(commit b663a413) - function
postgres_fdw_get_connections()
added (commit 708d165d) - function
postgres_fdw_disconnect()
added (commit 411ae649) - function
postgres_fdw_disconnect_all()
added (commit 411ae649) - table/server option
async_capable
added to enable asynchronous execution support (commit 27e1f145) - server option
keep_connections
added (commit b1be3074) - partitions specified in the
IMPORT FOREIGN SCHEMA ... LIMIT
clause can now be imported (commit a3740c48)
- support for bulk inserts; server/table-level option
- PostgreSQL 13
- options
sslkey
andsslcert
added at server and user mapping level to enable different users to authenticate with different certificates (commit f5fd995a) - passwordless non-superuser connections permitted, mainly to facilitate passwordless SSL authentication (commit 6136e94d)
- options
- PostgreSQL 12
- expand the number of cases where
ORDER BY
sorts andLIMIT
clauses can be pushed to remote servers (commits d50d172e and ffab494a) - Improve optimizer cost accounting for
postgres_fdw
queries (commits 08d2d58a, 8b6da83d and edbcbe27) - Properly honour
WITH CHECK OPTION
on views that referencepostgres_fdw
tables (a45adc74)
- expand the number of cases where
- PostgreSQL 11
- PostgreSQL 10
- PostgreSQL 9.6
- basic support added for remote joins (commits e4106b25 and aa09cd24)
- support added for remote sorts (commits f18c944b and ccd8f979)
- support added for directly modifying foreign tables with remote
UPDATE
s, andDELETE
s (commit 0bf3ae88) - the
fetch_size
option can now be applied to individual tables as well as the foreign server (commit dc203dc3) - query cancellation requests will be transmitted to the remote server (commits f039eaac and 1b812afb)
- user mappings which map to the same user on the remote server will be consolidated into a single remote connection (commit 96198d94)
- extension functions and operators, if specified in the
extensions
option, can be pushed down to the remove server (commit d8949416)
- PostgreSQL 9.4
- extended pushdown of
VARCHAR
columns through improved handling of collation-related decisions (commit 76f965ff)
- extended pushdown of
- PostgreSQL 9.3
- initial release (commit d0d75c40)
Examples
For an example of a postgres_fdw
setup, see the entry "foreign table".
References
- PostgreSQL documentation: postgres_fdw