SDB102[high]Destructive
Column dropped
Dropping a column deletes its data and breaks clients that still select it.
Why it's risky in PostgreSQL
ALTER TABLE … DROP COLUMN is fast, but the data is gone and any query that names the column fails.
Remove the column from application code and ORM models first, deploy, then drop it.
What triggers it, and the safer way
ALTER TABLE users DROP COLUMN legacy_role;-- Deploy app code that no longer uses legacy_role, then:
-- shadowdb:allow SDB102 column unused since release 41
ALTER TABLE users DROP COLUMN legacy_role;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 SDB102 <why this is safe here>Applies to PostgreSQL 14, 15, 16, 17.