Database Management
PostgreSQL
Subjective
Sep 25, 2025
Explain PostgreSQL foreign data wrappers (FDW).
Detailed Explanation
FDW allows PostgreSQL to access external data sources as if they were local tables.
Popular FDWs:
• postgres_fdw: Other PostgreSQL databases
• file_fdw: CSV files
• mysql_fdw: MySQL databases
• oracle_fdw: Oracle databases
Example:
CREATE EXTENSION postgres_fdw;
CREATE SERVER remote_server
FOREIGN DATA WRAPPER postgres_fdw
OPTIONS (host 'remote.example.com', dbname 'remote_db');
CREATE FOREIGN TABLE remote_users (
id INT,
name TEXT
) SERVER remote_server;Discussion (0)
No comments yet. Be the first to share your thoughts!
Share Your Thoughts