Skip to content

MG12 — DROP INDEX without CONCURRENTLY locks the table

Group: Migration safety · Auto-fixable: yes

Dropping an index without CONCURRENTLY takes an exclusive lock on the table for the duration of the drop. Use DROP INDEX CONCURRENTLY (outside a transaction block).

bad: DROP INDEX idx;
good: DROP INDEX CONCURRENTLY idx;

Disable this rule in banshee.toml:

[lint]
exclude = ["MG12"]

Or silence one line with -- noqa: MG12. See Linting.