SDB304[high]Rewrites
Stored generated column added
A STORED generated column is computed for every existing row.
Why it's risky in PostgreSQL
Adding GENERATED ALWAYS AS (…) STORED rewrites the table to fill the new column.
What triggers it, and the safer way
ALTER TABLE orders ADD COLUMN total_cents bigint GENERATED ALWAYS AS (qty * price_cents) STORED;ALTER TABLE orders ADD COLUMN total_cents bigint; -- fill via backfill + trigger insteadSuppress it when you're sure
Put this comment on the line before the statement. The reason is required and shows in the report.
-- shadowdb:allow SDB304 <why this is safe here>Applies to PostgreSQL 14, 15, 16, 17.