SDB503[high]Data-dependent
NOT NULL column added without a default
Fails on any table that already has rows.
Why it's risky in PostgreSQL
Existing rows have no value for the new column, so the statement errors on a non-empty table.
What triggers it, and the safer way
ALTER TABLE users ADD COLUMN plan text NOT NULL;ALTER TABLE users ADD COLUMN plan text NOT NULL DEFAULT 'free';Suppress 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 SDB503 <why this is safe here>Applies to PostgreSQL 14, 15, 16, 17.