PostgreSQL does not support nested transactions; only one transaction can run per session. If you attempt to use BEGIN, START TRANSACTION, COMMIT, ROLLBACK, or END inside an existing transaction, the server will issue a warning.
In Squawk, this issue often arises when using the assume-in-transaction mode. When assume-in-transaction is enabled, Squawk assumes your migration tool is already wrapping the migration file in a transaction. Including explicit transaction commands in your SQL files while this mode is active will cause conflicts.
To resolve this, choose one of the following strategies:
- If using
assume-in-transaction: Remove all explicit BEGIN and COMMIT statements from your SQL files. If a single file contains multiple logical transactions, split them into separate migration files. - If managing transactions manually: If your migration tool allows explicit transaction management within the SQL files, ensure
assume-in-transaction is set to false (or omitted) in your Squawk configuration so that Squawk does not assume an outer transaction exists.