Git answered a question about source files: who changed this line, when, and why. The same question about database rows has stayed awkward because tables change at a pace files never see. Gnomon, introduced as Git for Postgres data, drags that question to the place where most of the world's mutable state actually lives.
The trending query Gnomon: Git for Postgres Data reached the Hacker News front page in late November 2026, pulling in plenty of readers who once lost data and still remember it. The durable idea is that history is a feature you design for. Storage systems do not grow a past on their own; somebody has to record it.
Why rows are harder than files
Git treats a repository as a series of file snapshots and diffs them after the fact. A busy Postgres database changes millions of rows per minute, so snapshot-and-diff collapses immediately. Row-level versioning has to live inside the engine or its write path, where each change is visible at the moment it happens.
The write path is the pipeline a change travels from your UPDATE statement to disk. Intercepting it means every insert, update, and delete can be recorded with its old value, its new value, a timestamp, and the transaction that made it. That record is the raw material for git-style blame on data.
Two standard ways to record history
The first approach uses triggers, small procedures the database runs automatically on each change. An update trigger copies the old row into a history table before the new value lands. The logic sits close to the data, needs no external process, and works on any hosted Postgres that allows triggers.
The second approach reads the write-ahead log, the journal Postgres writes before applying any change, and streams those records into history off to the side. Log capture adds almost nothing to write latency because it observes the stream instead of intercepting it. The price is plumbing: a reader process, a place to put the records, and monitoring when either hiccups.
| Approach | How it works | Trade-off |
|---|---|---|
| Trigger plus history table | Copies each change as it happens | Simple, adds write overhead |
| Log-based capture | Reads the write-ahead log aside | Low overhead, more plumbing |
| What both record | Old value, new value, time, transaction | Grows fast without pruning |
| What both enable | Time travel, audits, rollbacks | Queries need indexes too |
Drop in your PDF - it doesn't leave your device.
Every miss becomes a red node on your map.
Free plan: 21 nodes, no card, no countdown.
What versioned data unlocks, and what it costs
With history recorded, time travel becomes a query: ask for the table as of yesterday at 14:00 and receive it. Audits gain a source of truth, and a bad migration can be reversed by replaying recorded values backwards. Teams debugging a mysterious data change get the same answer git blame gives for code.
The costs arrive on a schedule of their own. History tables grow without limit and slow every query that scans them. Partitioning, splitting history into chunks by month, plus pruning policies that expire old chunks keep the past from becoming the database's attic. The lesson is that history is a storage decision, and somebody must choose what to keep and for how long.
Key takeaways
- Git-style history for rows must live inside the engine or the write path, because tables change far too fast for snapshot-and-diff.
- Triggers copy each change into a history table as it happens, an approach most hosted Postgres services allow.
- Log-based capture reads the write-ahead log off to the side and adds little overhead to the writes themselves.
- Versioned data enables time travel queries, audits, and safe rollbacks of bad migrations.
- History tables need partitioning and pruning policies, or storage growth turns the past into the database's attic.
Quick answers
What is Gnomon?
A project described as Git for Postgres data: row-level version control that tracks who changed each value, when, and to what.
Why can git itself not track database rows?
Git diffs file snapshots; a busy database changes millions of rows per minute, so versioning must record changes as they happen.
What is a trigger?
A small procedure the database runs automatically when rows change, often used to copy the old row into a history table.
What is the write-ahead log?
The journal Postgres writes before applying changes; reading it off to the side records history with almost no extra write latency.
How do you keep history tables under control?
Partition them by time and prune old partitions on a schedule, so queries stay fast and storage stops climbing forever.
One thing to do tonight
Choose the one table you have most wanted to debug and sketch the question you would ask if last Tuesday were queryable. That single question tells you whether recording history would already have paid for itself.