Re: Question on locking

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Question on locking
Дата
Msg-id 26299.1099668833@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Question on locking  (Steve Tucknott <steve@retsol.co.uk>)
Список pgsql-novice
Steve Tucknott <steve@retsol.co.uk> writes:
> How can I detect the lock on process 2? I want to be able to tell the
> user that the row is tentatively locked and to allow them to abort the
> update attempt. I can't see a 'SET LOCK MODE TO NOT WAIT' style command,
> so how do I stop process 2 from waiting?

I see the thread moved off in a different direction, but to answer your
original question: what I'd probably do is set STATEMENT_TIMEOUT to the
maximum length of time I was willing to wait for the lock.  (This
assumes of course that the time spent to find the row is reasonably
predictable, since you have to allow for that too.)

            regards, tom lane

В списке pgsql-novice по дате отправления:

Предыдущее
От: Kjetil Haaland
Дата:
Сообщение: result from where clause
Следующее
От: "John-Paul Delaney"
Дата:
Сообщение: Re: Install 7.4.6 on Redhat 8.0 - Any issues?