Error code

PostgreSQL 25P02

POSTGRESQL25P02
Database Error Code· An error code returned by a database server such as PostgreSQL or MySQL.

What it means

in_failed_sql_transaction — the current transaction has already failed.

How to fix it

  1. Issue ROLLBACK before starting new work after any error inside a transaction block.
  2. Use savepoints (SAVEPOINT / ROLLBACK TO) to recover from errors within a transaction without aborting the whole transaction.
  3. Ensure application error-handling code always rolls back or closes aborted transactions.

Not affiliated with PostgreSQL. Answer summarized from the manufacturer's manual linked above; consult that source for the authoritative procedure.