Skip to content

MG21 — BEGIN/START issued inside an open transaction

Group: Migration safety · Auto-fixable: no

A BEGIN/START while a transaction is already open nests: Postgres ignores the inner BEGIN and the next COMMIT ends the outer transaction early, which is rarely intended.

bad: BEGIN; BEGIN; COMMIT; COMMIT;
good: BEGIN; COMMIT;

Disable this rule in banshee.toml:

[lint]
exclude = ["MG21"]

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