Building pgmt: Schema-First Postgres Migrations
Details
pgmt is an open-source Postgres migration tool built on a simple idea: you maintain your schema as plain SQL files describing the desired state, and Postgres itself computes the migration. It works by applying your schema to a temporary "shadow" database and reading back through pg_catalog and pg_depend. That includes the full dependency graph between objects, like views, functions, triggers, RLS policies, partial indexes, and everything else Postgres knows about, not just tables and columns.
Every other part of your application stack lets you edit the end state and figures out the path. Databases haven't worked that way. pgmt is my attempt to fix that.
Greg will walk through the workflow live -- editing schema files, watching pgmt generate dependency-correct migrations, and using the same engine for drift detection and CI validation -- and show where the approach shines and where Postgres's catalog has blind spots.
You'll leave this talk with concrete catalog queries you can borrow and a clearer mental model of how Postgres tracks schema dependencies.
This session will be hosted by Ryan Booz and Greg Potter. Ryan is a Solutions Engineer at pganalyze (and he’s one of our Meetup for All organizers). Greg Potter is a software engineer at Betterment, creator of pgmt, and has a dog named Harry... for obvious reasons.
