Skip to content
RED SAG Skills
hardStudy question · answer published in PostgreSQL interview questions, so no pointspostgresqlschema-changes

ADD COLUMN that rewrote the table

On PostgreSQL 16, ALTER TABLE t ADD COLUMN a int DEFAULT 0 finished instantly, but ADD COLUMN b uuid DEFAULT gen_random_uuid() locked the table for an hour. Why?

Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions