Skip to content

MG19 — CREATE INDEX CONCURRENTLY cannot run inside a transaction

Group: Migration safety · Auto-fixable: no

CREATE INDEX CONCURRENTLY is rejected by Postgres inside a transaction block. Move it out of the BEGIN/COMMIT so the concurrent build can run.

bad: BEGIN; CREATE INDEX CONCURRENTLY idx ON t (a); COMMIT;
good: CREATE INDEX CONCURRENTLY idx ON t (a);

Disable this rule in banshee.toml:

[lint]
exclude = ["MG19"]

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