Presented by:

Greg Potter

pgmt.dev

Greg Potter is a software engineer and creator of pgmt, an open-source PostgreSQL migration tool. He's been building applications on PostgreSQL for a decade, and spent the last few years digging into the internals to understand how it actually works.

No video of the event yet, sorry!

If you’ve ever stared at a 200-file migrations directory wondering what your schema actually looks like, or fought with a migration DSL that couldn’t express a partial index, you’ve hit the limits of traditional migration tooling.

This talk explores a different approach: keeping your schema in plain SQL and letting PostgreSQL itself compute migrations. Instead of parsing SQL or re-implementing dependency tracking, you apply schemas to a temporary "shadow" database and read back from the system catalogs. PostgreSQL already knows that a view depends on a function, which depends on a type. You just have to ask it.

I learned these techniques the hard way while building pgmt, an open-source PostgreSQL migration tool. Along the way, I put the shadow database pattern to work, dug into pg_depend and the system catalogs, and confronted the edge cases where PostgreSQL’s dependency tracking has blind spots (function bodies, implicit sequences, extension-owned objects).

The techniques apply anywhere you need to understand a PostgreSQL schema programmatically: migration tools, linters, drift detectors, or CI validation. You’ll leave with concrete catalog queries you can adapt and a clearer mental model of how PostgreSQL tracks and orders schema dependencies.

Date:
2026 April 22 16:30 PDT
Duration:
20 min
Room:
San Pedro (Level C)
Conference:
Postgres Conference: 2026
Language:
Track:
Dev
Difficulty:
Medium