PostgreSQL 17 runners are live
All rules

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

unsafe.sql
BEGIN;
UPDATE plans SET price = 10 WHERE id = 3;
COMMIT;
safer.sql
UPDATE plans SET price = 10 WHERE id = 3; -- let the tool manage the transaction

Suppress it when you're sure

Put this comment on the line before the statement. The reason is required and shows in the report.

suppression
-- shadowdb:allow SDB602 <why this is safe here>

Applies to PostgreSQL 14, 15, 16, 17.