'Waiting on lock'

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: 'Waiting on lock'
Date: 2007-05-30 15:05:02
Message-ID: 20070530150502.GX7531@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greetings,

It'd be nice to have a NOTICE printed when a wait-on-lock takes longer
than a few seconds. It doesn't need to be precise and it doesn't have
to be repeated over and over, just once. Perhaps even controlled by a
GUC, though NOTICEs are generally ignored by non-interactive
applications anyway, I believe.

I'd say if the lock hasn't been aquired after 5 seconds, print
something like:

NOTICE: Waiting on lock

If it's available easily we might also list the type of lock, the OID,
the table name, whatever, and perhaps the PID of whomever has the lock
currently.

It's just very frustrating to kick off something you expect to run for
a while and come back quite a long time later to discover that it was
blocked because another transaction had a lock. This mainly happens
to us when scripts do things like drop tables while someone else has a
transaction which was using that table some time in the past and they
havn't committed yet.

Thanks,

Stephen

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-05-30 15:14:12 Re: TOAST usage setting
Previous Message Gregory Stark 2007-05-30 15:02:26 Re: TOAST usage setting