Skip site navigation (1) Skip section navigation (2)

Re: Improving deadlock error messages

From: Neil Conway <neilc(at)samurai(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Improving deadlock error messages
Date: 2007-04-21 23:43:34
Message-ID: 1177199014.16415.116.camel@localhost.localdomain (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On Sat, 2007-04-21 at 17:56 -0400, Neil Conway wrote:
> Right, I'm envisioning doing a conditional LockAcquire and then
> heap_open() / heap_getnext() by hand. That will be relatively slow, but
> code that emits a deadlock error message is almost by definition not
> performance critical.

... although it turns out you'd need to conditionally lock a *lot* of
system catalogs to guarantee that you're not going to block on a lock at
some point. Needless to say, that approach would be pretty ugly and

> BTW, another alternative would be to set a global variable instructing
> LockAcquire() to not block waiting for a lock; instead, it would
> longjmp(), a la elog(ERROR). You could even construct something similar
> to PG_TRY()

Attached is a very quick hack of a patch to do this.


Attachment: deadlock_error_msg-4.patch
Description: text/x-patch (8.2 KB)

In response to


pgsql-hackers by date

Next:From: Nabucodonosor CoutinhoDate: 2007-04-22 00:13:53
Subject: PgAdmin pt_BR traduction
Previous:From: Tom LaneDate: 2007-04-21 23:21:10
Subject: Re: [HACKERS] parser dilemma

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group