Schema evolution without the fear
Every data team eventually has to change a column type under live readers. The usual reaction is a freeze window and a risky deploy. It does not have to be that way — the database has supported the safe pattern for years, we just do not use it.
The expand / migrate / contract pattern
Add the new column, write both, read the new one behind a view, then remove the old path when nothing depends on it. The key is that each step is independently reversible and no step requires stopping writers.
If a migration cannot be run twice without changing the result, it is not a migration — it is an outage waiting for a retry.
Testing it before production
We run the migration against a snapshot with the consumers' queries attached as a test suite. If a view returns a different type or a different row count, the test fails before anyone opens a ticket.
-- verify the view is type-stable
SELECT pg_typeof(event_key) FROM events_v1 LIMIT 1;
-- compare counts against the old path
SELECT count(*) FROM events_v1
WHERE id BETWEEN 1 AND 1000000;
What good looks like
No maintenance window, no double-write without expiry, and a documented date when the old column is dropped. The fear goes away when the rollback is boring.