marmelab
Read post

Foreign Data Wrapper: Postgresify all the things!

PostgreSQL's Foreign Data Wrapper (FDW) feature allows querying external data sources directly via SQL, treating them as virtual tables. The post covers four use cases: querying CSV files with the built-in file_fdw extension, connecting to another PostgreSQL database with postgres_fdw, accessing NoSQL databases like MongoDB using existing FDW extensions or custom ones built with Multicorn (a Python library), and wrapping REST APIs as queryable foreign tables. Multicorn enables building custom FDW extensions for virtually any data source, including authenticated APIs. The approach eliminates the need for custom ETL scripts or cron jobs to sync external data.

    #postgresql#mongodb#rest-api
Jun 03•5m read time•From marmelab.com
Post cover image
Table of contents
Querying a CSV FileQuerying Another PostgreSQL DatabaseQuerying A NoSQL DatabaseQuerying a REST APIConclusion
1.8K Impressions
marmelab's image
marmelab

95 Followers

•

1.6K Upvotes

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard