PostgreSQL 17 runners are live
All rules

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

unsafe.sql
ALTER TABLE orders ADD COLUMN total_cents bigint GENERATED ALWAYS AS (qty * price_cents) STORED;
safer.sql
ALTER TABLE orders ADD COLUMN total_cents bigint; -- fill via backfill + trigger instead

Suppress it when you're sure

Put this comment on the line before the statement. The reason is required and shows in the report.

suppression
-- shadowdb:allow SDB304 <why this is safe here>

Applies to PostgreSQL 14, 15, 16, 17.