Re: SELECT ... FOR UPDATE [WAIT integer | NOWAIT] for 8.5

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: SELECT ... FOR UPDATE [WAIT integer | NOWAIT] for 8.5
Дата
Msg-id 291.1242053201@sss.pgh.pa.us
обсуждение исходный текст
Ответ на SELECT ... FOR UPDATE [WAIT integer | NOWAIT] for 8.5  (Hans-Juergen Schoenig <postgres@cybertec.at>)
Ответы Re: SELECT ... FOR UPDATE [WAIT integer | NOWAIT] for 8.5  (Boszormenyi Zoltan <zb@cybertec.at>)
Re: SELECT ... FOR UPDATE [WAIT integer | NOWAIT] for 8.5  (Hans-Jürgen Schönig <postgres@cybertec.at>)
Список pgsql-hackers
Hans-Juergen Schoenig <postgres@cybertec.at> writes:
> i would like to propose an extension to our SELECT FOR UPDATE mechanism.
> especially in web applications it can be extremely useful to have the 
> chance to terminate a lock after a given timeframe.

I guess my immediate reactions to this are:

1. Why SELECT FOR UPDATE in particular, and not other sorts of locks?

2. That "clear and easy to use" oracle syntax sucks.  You do not want
to be embedding lock timeout constants in your application queries.
When you move to a new server and the appropriate timeout changes,
do you want to be trying to update your clients for that?

What I think has been proposed previously is a GUC variable named
something like "lock_timeout", which would cause a wait for *any*
heavyweight lock to abort after such-and-such an interval.  This
would address your point about not wanting to use an overall
statement_timeout, and it would be more general than a feature
that only works for SELECT FOR UPDATE row locks, and it would allow
decoupling the exact length of the timeout from application query
logic.
        regards, tom lane


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: [PATCH] Automatic client certificate selection support for libpq v1
Следующее
От: Tom Lane
Дата:
Сообщение: Re: SSL cert chains patch