Monday, March 7, 2011

Postgresql query to find out how long any open transaction has been running for

0 comments
I use the following query to find out how long any open transaction has been running for in Postgresql 9.0.1:

SELECT
client_addr,
application_name
current_timestamp - xact_start AS running_time,
current_query
FROM pg_stat_activity
ORDER BY running_time;

Leave a Reply

Labels