Kyle, one way to analyze this further would be if you could run the following query directly in a psql client at the time the problem occurs, and give us the output. This will display all running queries and the locks they hold:
-- Diagnose locks
select pg_stat_activity.datname, pg_class.relname, pg_locks.transactionid, pg_locks.virtualxid, pg_locks.virtualtransaction, pg_locks.mode, pg_locks.granted, pg_stat_activity.usename, pg_stat_activity.current_query, pg_stat_activity.query_start, pg_stat_activity.procpid
from pg_stat_activity,
pg_locks left outer join pg_class
on (pg_locks.relation = pg_class.oid)
where pg_locks.pid=pg_stat_activity.procpid
and procpid != pg_backend_pid()
order by procpid, query_start;
You can attach the output as a text file or put it on http://pastebin.com/ or similar, in order to avoid issues with comment wrapping.
Kyle, one way to analyze this further would be if you could run the following query directly in a psql client at the time the problem occurs, and give us the output. This will display all running queries and the locks they hold:
-- Diagnose locks
pg_stat_ activity. datname,
pg_class. relname,
pg_locks. transactionid,
pg_locks. virtualxid,
pg_locks. virtualtransact ion,
pg_locks. mode,
pg_locks. granted,
pg_stat_ activity. usename,
pg_stat_ activity. current_ query,
pg_stat_ activity. query_start,
pg_stat_ activity. procpid pid=pg_ stat_activity. procpid
select
from pg_stat_activity,
pg_locks left outer join pg_class
on (pg_locks.relation = pg_class.oid)
where pg_locks.
and procpid != pg_backend_pid()
order by procpid, query_start;
You can attach the output as a text file or put it on http:// pastebin. com/ or similar, in order to avoid issues with comment wrapping.
Thanks!