Timestamptz or timestamp for event times

Back to list2026-08-16
You

timestamptz or timestamp for event times?

ChatGPT

timestamptz almost always. It stores a point in time in UTC and converts on the way out; timestamp stores a wall clock reading with no idea which wall it was on, which becomes unrecoverable once daylight saving moves.

You

Adding a NOT NULL column locked our table for two minutes. How do people avoid that?

ChatGPT

Split it: add the column nullable, backfill in batches, add a validated check constraint, then set NOT NULL. Each step takes a brief lock instead of one long one, and the backfill can be paused if replication lag grows.