SQLSTATE 25P02Severity mediumLab verified

Incident brief

Current transaction is aborted, commands ignored until end of transaction block

One statement inside a transaction failed. PostgreSQL now rejects every later command in that same transaction until it sees ROLLBACK, even if those later commands are perfectly valid on their own.

Reproduced on PostgreSQL 16.14Verified 2026-07-15 (Docker lab, PostgreSQL 16.14)Reviewed by Verified against PostgreSQL 16.14 in an isolated lab environment

In 10 seconds

What
Current transaction is aborted, commands ignored until end of transaction block
What triggers it
Start a transaction with BEGIN.
The fix
ROLLBACK the transaction and start again.
Proof
Reproduced on PostgreSQL 16.14 → The division-by-zero error aborted the transaction. The next INSERT was rejected even though it is a valid statement on its own, and ROLLBACK discarded both inserts — the table ended up empty.

The fix

What to do right now

The immediate, application-level response to this error.

  • ROLLBACK the transaction and start again.
  • Or place a SAVEPOINT before risky statements so you can ROLLBACK TO the savepoint instead of losing everything.
  • Stop sending commands as soon as the first error appears. They will all be rejected until ROLLBACK.
Fix — SQL
BEGIN;
INSERT INTO finance.ledger (id, amount) VALUES (10, 100);
SAVEPOINT before_risky;
-- a statement that might fail goes here
ROLLBACK TO SAVEPOINT before_risky;
-- the transaction is usable again
INSERT INTO finance.ledger (id, amount) VALUES (11, 50);
COMMIT;

Related & next steps

Follow the thread

Everything this error touches — jump straight to the sibling error, term, runbook, or parameter.

Verification

PG 16.14
Last verified
2026-07-15 (Docker lab, PostgreSQL 16.14)
Reviewed by
Verified against PostgreSQL 16.14 in an isolated lab environment
Audit status
reviewed