Re: timeout on lock feature - Mailing list pgsql-hackers

From Tom Lane
Subject Re: timeout on lock feature
Date
Msg-id 4982.987184866@sss.pgh.pa.us
Whole thread Raw
In response to Re: timeout on lock feature  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: timeout on lock feature  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> I was thinking SET because UPDATE does an auto-lock.

Not to mention a ton of implicit locks acquired on various system tables
during parsing/planning.  You really want auto timeout on all of those?
I sure don't.

The appropriate way to do this given a LOCK TABLE option would be like
BEGIN;LOCK TABLE foo IN ROW EXCLUSIVE MODE WITH TIMEOUT n;UPDATE foo SET ...;COMMIT;

which restricts the scope of the timeout behavior to just the specific
lock that the user is thinking of, and doesn't risk breaking fundamental
system operations.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: timeout on lock feature
Next
From: ncm@zembu.com (Nathan Myers)
Date:
Subject: Truncation of object names