Diagnosing deadlock / connection hang

From: "Jeremy Haile" <jhaile(at)fastmail(dot)fm>
To: pgsql-general(at)postgresql(dot)org
Subject: Diagnosing deadlock / connection hang
Date: 2007-01-17 15:18:38
Message-ID: 1169047118.26250.1169723207@webmail.messagingengine.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a process that appears to hang every night. I ran the following
query and results, and it looks like an autoanalyze and query are
waiting on a lock that's being exclusively held by a transaction that is
IDLE. Any ideas? Any additional queries I should run to shed light on
the issue?

SELECT pg_database.datname AS database, pg_class.relname AS table,
transaction, pid, mode, granted, usename, current_query, backend_start
FROM pg_locks, pg_class, pg_database, pg_stat_activity
WHERE pg_locks.relation = pg_class.oid
AND pg_locks.database = pg_database.oid
and pg_locks.pid = pg_stat_activity.procpid
order by pg_database.datname, pg_class.relname, granted

"dashboard";"activity_log_transition";18291984;1588;"ShareUpdateExclusiveLock";f;"postgres";"ANALYZE
public.activity_log_transition";"2007-01-17 00:06:03.281-05"
"dashboard";"activity_log_transition";18291982;2872;"AccessShareLock";f;"dashboard";"select
distinct strDescription from activity_log_transition";"2007-01-17
00:05:03.281-05"
"dashboard";"activity_log_transition";18291979;1472;"ShareLock";t;"dashboard";"<IDLE>
in transaction";"2007-01-17 00:05:00.968-05"
"dashboard";"activity_log_transition";18291979;1472;"AccessExclusiveLock";t;"dashboard";"<IDLE>
in transaction";"2007-01-17 00:05:00.968-05"
"dashboard";"activity_log_transition_pkey";18291979;1472;"AccessExclusiveLock";t;"dashboard";"<IDLE>
in transaction";"2007-01-17 00:05:00.968-05"

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2007-01-17 15:42:51 Re: Index bloat of 4x
Previous Message Tom Lane 2007-01-17 15:06:00 Re: Controlling memory of session