packagemain.tech

packagemain.tech

Mastering cross-database operations with PostgreSQL FDW

A guide to schema import, archival policies, and automation

Julien Singler's avatar
Julien Singler
Feb 08, 2025
∙ Paid

Introduction

Modern applications often rely on data scattered across multiple databases. PostgreSQL’s Foreign Data Wrapper (FDW) empowers you to query and manipulate external databases as if they were native PostgreSQL tables. Combined with pg_cron for scheduling and stored procedures for automation, you can build robust archival pipelines.

In this post we will talk about:

  • Setting up FDW to connect to external databases (ex: another PostgreSQL instance).

  • Importing foreign schemas.

  • Creating archival policies with stored procedures

  • Automating archival tasks with pg_cron

User's avatar

Continue reading this post for free, courtesy of Alex Pliutau.

Or purchase a paid subscription.
© 2026 Aliaksandr Pliutau · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture