Re: How to know whether a table is locked ?

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Nicolas Bazin <nbazin(at)ingenico(dot)com(dot)au>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: How to know whether a table is locked ?
Date: 2002-04-23 20:55:57
Message-ID: 200204232055.g3NKtvV17981@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Nicolas Bazin wrote:
> I read a thread about table lock timeout but don't know whether
> anything has been done about it.
>
> Here is what I'd like to do: I don't want my transactions to
> be on hold for too long so I'd like to use a syntax I use on
> INFORMIX already: SET LOCK MODE TO [WAIT [second] | NOT WAIT]
> I'm using ecpg and I think I'm up to make a patch to it to
> support the WAIT [second] with the asynchronous functions but
> I need a way to know whether a statement would lock from the
> back-end to implement the NOT WAIT. Is there a way?

We are discussing a SET timeout parameter that would do something
similar. However, it will not be done until 7.3, at the earliest. The
only solution right now would be to do an alarm() and issue a query
cancel after the alarm sounds.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2002-04-23 23:30:06 Re: "make report"
Previous Message Bruce Momjian 2002-04-23 20:26:18 Re: Coster/planner and edge cases...