The following bug has been logged online:
Bug reference: 3907
Logged by: Martin Fandel
Email address: martin.fandel@payzone.de
PostgreSQL version: 8.2.5
Operating system: Suse Linux Enterprise 10
Description: Deadlock while "vacuum verbose analyze" runs...
Details:
Hi,
on this weekend my database runs into a deadlock every time I run "vacuum
verbose analyze".
The logfile show this:
ERROR: deadlock detected
DETAIL: Process 7951 waits for ShareLock on transaction 193734734; blocked
by process 8576.
Process 8576 waits for ShareLock on transaction 193734768; blocked
by process 7951.
I don't know why it's locked. Hopefully someone can help me to fix the
problem?
If they are any informations needed, please let me know.
I've seen many ungranted deadlocks. I've used this query for view it:
SELECT dbu.usename as locker, l.mode as locktype,
pg_stat_get_backend_pid(S.backendid) as pid,
db.datname||'.'||n.nspname||'.'||r.relname as relation, l.mode,
substring(pg_stat_get_backend_activity(S.backendid ), 0, 30) as query FROM
pg_user dbu, (SELECT pg_stat_get_backend_idset() AS backendid) AS S,
pg_database db, pg_locks l, pg_class r, pg_namespace n WHERE db.oid =
pg_stat_get_backend_dbid(S.backendid) AND dbu.usesysid =
pg_stat_get_backend_userid(S.backendid) AND l.pid =
pg_stat_get_backend_pid(S.backendid) AND l.relation = r.oid AND l.database =
db.oid AND l.database = db.oid AND l.granted ORDER BY db.datname, n.nspname,
r.relname, l.mode;
Thanks!
Best regards,
Martin