ALTER TABLE referencing ADD COLUMN test_1 integer DEFAULT (alter_table_add_column_other_schema.my_random(7) + random() + 5) NOT NULL CONSTRAINT fkey REFERENCES referenced(int_col) ON UPDATE SET ...
Just spent 6 hours chasing a 30× query slowdown that appeared overnight on a 1.2 TB production cluster. No schema changes, no new code, no autovacuum issues. Root cause? A single ALTER TABLE ... ADD ...
Adds columns to, drops columns from, and changes column attributes in an existing table. Adds, modifies, and drops integrity constraints from an existing table. Restriction: You cannot use any type of ...