1

I'm debugging lots of "idle in transactions" queries in my database. I was able to trace some of them back to the source code and fix the runaway sessions, but for others I can't easily tell where the query originates in the source code to fix it.

I think would be possible if I started logging stacks for all of the queries like here, but probably there's an easier way.

My query to find the long transactions look like this:

select query_start, application_name, state, query,*
from pg_stat_activity
and state != 'idle'
order by query_start
2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.