PostgreSQL 17 runners are live
All rules

SDB202[medium]Indexes

Index dropped without CONCURRENTLY

DROP INDEX takes an ACCESS EXCLUSIVE lock on the table.

Why it's risky in PostgreSQL

Dropping an index normally blocks reads and writes on its table while the lock is held. DROP INDEX CONCURRENTLY avoids that.

What triggers it, and the safer way

unsafe.sql
DROP INDEX orders_status_idx;
safer.sql
DROP INDEX CONCURRENTLY orders_status_idx;

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 SDB202 <why this is safe here>

Applies to PostgreSQL 14, 15, 16, 17.