How to add a CHECK constraint without downtime
Adding CHECK constraints can be helpful to:
Adding CHECK constraints can be helpful to:
Add a column in PostgreSQL safely under load using lock_timeout, retries, DEFAULT and NOT NULL rules, and backfilling.
Drop a PostgreSQL column safely without downtime using lock_timeout, retries, rollout order, and reclaiming disk space.
Postgres provides the ability to enable data checksums, which is a good way to protect from certain types of corruption (not all of them).
Redefining a PK (primary key) is not a difficult procedure, yet it requires a few non-trivial steps to be done.
Some time ago (Jan 2024), on HackerNews, an article by knock.app was discussed, on zero downtime Postgres upgrades.