Pgschema – Declarative Schema Migration for Postgres
Posted4 months agoActive4 months ago
pgschema.comTechstory
calmmixed
Debate
20/100
Database MigrationPostgresSchema Management
Key topics
Database Migration
Postgres
Schema Management
Pgschema is a declarative schema migration tool for Postgres, sparking discussion on its potential benefits and comparisons to existing migration tools.
Snapshot generated from the HN discussion
Discussion Activity
Light discussionFirst comment
52m
Peak period
3
3-4h
Avg / period
1.5
Key moments
- 01Story posted
Sep 12, 2025 at 12:45 PM EDT
4 months ago
Step 01 - 02First comment
Sep 12, 2025 at 1:38 PM EDT
52m after posting
Step 02 - 03Peak activity
3 comments in 3-4h
Hottest window of the conversation
Step 03 - 04Latest activity
Sep 13, 2025 at 1:36 AM EDT
4 months ago
Step 04
Generating AI Summary...
Analyzing up to 500 comments to identify key contributors and discussion patterns
ID: 45224028Type: storyLast synced: 11/20/2025, 6:24:41 PM
Want the full context?
Jump to the original sources
Read the primary article or dive into the live Hacker News thread when you're ready.
I want to manage my database items like I manage my code. I get a hierarchical folder structure of items with support for goToDefinition and findReferences, and when I update my code I can run something that generates the diff migration. That way I can see historical context of what has changed and when, rather than looking through migration files grepping for the fields or function names of interest.
The migration log ends up being your changelog, except that it's not a simple diff (create or replace function with the whole definition of the function rather than the diff).
Internally it would materialize it all into a schema which could not only be used for things like go to def, but also for diffing against another schema - either a previous build, or your live db, and subsequently emitted as a migration. It was magical, but flew under the radar, and these days any individual stuck working with SQL Server deserves many condolences.
We use it internally to create folder-like structure representation of our database schema.
https://github.com/gajus/pg-dump-parser?tab=readme-ov-file#r...
Very handy when reviewing changes in version control, etc.
AGPL https://github.com/pgschema/pgschema/blob/97f4bf5c00fd10add5...
MIT https://github.com/pgschema/pgschema/blob/53313057201931b2e8...
Whatever the fuck this is, that ain't community that's "I made up a licence how hard can it be": https://github.com/pgschema/pgschema/blob/6f5ce89cc1ac12f4a6...
https://x.com/mitchellh/status/1964785527741427940