Re: timeout on lock feature

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Henryk Szal <szal(at)doctorq(dot)com(dot)pl>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: timeout on lock feature
Date: 2001-04-13 18:01:06
Message-ID: 4982.987184866@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-04-13 18:28:46 Re: pg_dump ordering problem (rc4)
Previous Message Nathan Myers 2001-04-13 17:50:31 Truncation of object names