Re: Improving deadlock error messages - Mailing list pgsql-hackers

From Neil Conway
Subject Re: Improving deadlock error messages
Date
Msg-id 1177199014.16415.116.camel@localhost.localdomain
Whole thread Raw
In response to Re: Improving deadlock error messages  (Neil Conway <neilc@samurai.com>)
Responses Re: Improving deadlock error messages
List 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
fragile.

> 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.

-Neil


Attachment

pgsql-hackers by date:

Previous
From: Neil Conway
Date:
Subject: Re: Improving deadlock error messages
Next
From: "Nabucodonosor Coutinho"
Date:
Subject: PgAdmin pt_BR traduction