Foreign Data Wrappers (FDW)
Foreign Data Wrappers (FDW) are PostgreSQL's implementation of the SQL/MED standard defined by ISO/IEC 9075-9:2003. PostgreSQL is the first (and so far only) mainstream RDBMS to provide this capability, which was initially added in release 9.1 and has been extended continually ever since.
Availability
Foreign data wrappers are available for many other databases and datastores, as well as a variety of alternative data sources including flat files, web APIs etc. See this matrix for an overview of FDWs available for other SQL databases.
History
Timeline of SQL/MED implementation in PostgreSQL:
- PostgreSQL 9.4: Triggers now supported on foreign tables
- PostgreSQL 9.3: write support for FDWs added; "contrib/postgres_fdw" included in the core distribution
- PostgreSQL 9.2: improvements to the planning API for foreign data wrappers
- PostgreSQL 9.1: "contrib/file_fdw" added as a read-only foreign data wrapper for flat files
- PostgreSQL 8.4: some internal support for SQL/MED added
Links
- Foreign data wrappers on the PostgreSQL Wiki
- Foreign data wrappers at the PostgreSQL extension network (PGXN) (note that not all FDWs are available on PGXN)
Articles
Articles and blog posts about foreign data wrappers
- Global sequences with postgres_fdw and Postgres core
- Sharing sequences across multiple PostgreSQL instances (Michael Paquier)
- Generating Create Foreign Table Statements for postgres_fdw
- PostGIS-orientated but interesting approach (Leo Hsu/Regina Obe)
- Foreign Data Wrappers for PostgreSQL 9.4 Windows
- file_textarray_fdw, www_fdw and ogr_fdw packaged for Windows (Leo Hsu/Regina Obe)