ALTER TABLE orders ADD COLUMN status text DEFAULT 'pending'; -- Backfill in batches, then: ALTER TABLE orders ADD CONSTRAINT orders_status_not_null CHECK (status IS NOT NULL) NOT VALID; ALTER TABLE orders VALIDATE CONSTRAINT orders_status_not_null;