liveBook · Manning

Foreign data wrapper

As explained in Just Use Postgres!

A foreign data wrapper is a PostgreSQL extension interface that represents and queries data from an external data source.

A foreign data wrapper (FDW) is a PostgreSQL extension interface for connecting to external data sources and querying remote data transparently with standard SQL, as though it were stored in regular PostgreSQL tables. section 7.3

FDWs can make PostgreSQL a unified data layer across several source types:

  • Query files through file_fdw. section 7.3
  • Connect to PostgreSQL, MySQL, Oracle, or SQLite through postgres_fdw, mysql_fdw, oracle_fdw, or sqlite_fdw. section 7.3
  • Retrieve data from Redis, S3, or Kafka through redis_fdw, parquet_s3_fdw, or kafka_fdw. section 7.3

One SQL-facing data layer

An application can use PostgreSQL as a unified access point: an FDW exposes a remote database, file system, or non-SQL source, and queries use standard SQL rather than source-specific access patterns. section 7.3

How Just Use Postgres! covers it

How deep it goes
Defines transparent querying and names supported sources, but stops short of setup, configuration, and execution internals.
Examples
Uses file_fdw, postgres_fdw, mysql_fdw, oracle_fdw, sqlite_fdw, redis_fdw, parquet_s3_fdw, and kafka_fdw.
What you can do after
Apply it via an FDW extension to query files, remote SQL databases, Redis, S3, or Kafka through standard SQL.
How it connects
Connects PostgreSQL extensions, standard SQL, remote databases, file systems, and non-SQL data sources.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Just Use Postgres!. The section links point to the parts of the book it draws on.