Foreign Data Wrapper
ELI5 - The Vibe Check
A foreign data wrapper lets Postgres pretend a completely different system, another database, a CSV file, even a REST API, is just another local table. You write a normal SELECT, and Postgres quietly reaches across the wire to fetch the real data and hands it back like nothing weird happened.
Real Talk
A Foreign Data Wrapper (FDW) is a PostgreSQL extension mechanism that exposes external data sources as foreign tables queryable with standard SQL. Popular wrappers like postgres_fdw and mysql_fdw let a single Postgres connection join across systems without building a separate ETL step.
Show Me The Code
CREATE EXTENSION postgres_fdw;
CREATE SERVER remote_db FOREIGN DATA WRAPPER postgres_fdw
OPTIONS (host 'other-host', dbname 'analytics');
CREATE FOREIGN TABLE remote_orders (id int, total numeric)
SERVER remote_db OPTIONS (table_name 'orders');
When You'll Hear This
"We used an FDW to join the analytics DB straight from the app database." / "postgres_fdw saved us from building a whole sync pipeline."
Related Terms
Data Warehouse
A data warehouse is where all your company's data goes to be analyzed.
PostgreSQL
PostgreSQL (just say 'Postgres') is the Swiss Army knife of databases.
Reverse ETL
Normal ETL pulls messy data out of your apps and pushes it into a tidy warehouse.
SQL (Structured Query Language)
SQL is the language you use to talk to a database. You ask it things like 'give me all users who signed up this week' and it actually does it.