Install the built-in foreign data wrapper for PostgreSQL servers.

Section: Foreign Data Wrappers and Cross-DB Access

Enable postgres_fdw

sql
sql
CREATE EXTENSION IF NOT EXISTS postgres_fdw;
Explanation

See summary for usage details.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Foreign Data Wrappers and Cross-DB Access
Create foreign server
Define a remote PostgreSQL server.
OpenIn sheetsqlsame section
Create user mapping
Store remote authentication details for one local role.
OpenIn sheetsqlsame section
Import foreign schema
Bring remote tables into a local schema automatically.
OpenIn sheetsqlsame section
Create foreign table manually
Define a foreign table manually.
OpenIn sheetsqlsame section
Drop foreign server
Remove the foreign server and dependent objects.
OpenIn sheetsqlsame section
Enable pg_trgm
Install trigram support for similarity search and GIN/GiST indexes.
OpenIn sheetsql1 tag match