SDB602[high]Transactions
Nested BEGIN/COMMIT in a wrapped file
Explicit transaction statements inside a tool-wrapped file break atomicity.
Why it's risky in PostgreSQL
If your tool already wraps the file in a transaction, an inner COMMIT ends it early and the rest of the file runs outside it.
What triggers it, and the safer way
BEGIN;
UPDATE plans SET price = 10 WHERE id = 3;
COMMIT;UPDATE plans SET price = 10 WHERE id = 3; -- let the tool manage the transactionSuppress it when you're sure
Put this comment on the line before the statement. The reason is required and shows in the report.
-- shadowdb:allow SDB602 <why this is safe here>Applies to PostgreSQL 14, 15, 16, 17.