PostgresDB 25P03: Idle in Transaction Session Timeout

Transaction session timed out due to idleness.
  1. Identify the offending transaction/query causing the timeout by checking the current activity in the database:
  2. SELECT pid, usename, application_name, state, query, state_change FROM pg_stat_activity WHERE state = 'idle in transaction';
  3. Terminate the idle transaction using the PID obtained from the above query:
  4. SELECT pg_terminate_backend(<pid_here>);
  5. Review application logs connected to the PostgreSQL database for any transactions that were not properly closed or committed. This can help identify the part of your application responsible for the issue.
  6. Adjust the idle_in_transaction_session_timeout setting to a suitable value, if necessary, based on the investigation findings to prevent future occurrences:
  7. ALTER SYSTEM SET idle_in_transaction_session_timeout = '5min';
  8. Followed by reloading the configuration:
  9. SELECT pg_reload_conf();

Never debug

PostgresDB

manually again

Let Dr. Droid create custom investigation plans for your infrastructure.

Start Free POC (15-min setup) →
Automate Debugging for
PostgresDB
See how Dr. Droid creates investigation plans for your infrastructure.

MORE ISSUES

Made with ❤️ in Bangalore & San Francisco 🏢

Doctor Droid