Re: SKIP LOCKED DATA (work in progress)

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: SKIP LOCKED DATA (work in progress)
Дата
Msg-id 20140804160244.GH5475@eldon.alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: SKIP LOCKED DATA (work in progress)  (David Rowley <dgrowleyml@gmail.com>)
Список pgsql-hackers
David Rowley wrote:

> The only notes I can think to leave for the commiter would be around the
> precedence order of the lock policy, especially around a query such as:
> 
> SELECT * FROM (SELECT * FROM a FOR UPDATE SKIP LOCKED) a FOR UPDATE; --
> skip locked wins
> 
> Of course the current behaviour is that NOWAIT wins over the standard FOR
> UPDATE, but with NOWAIT, there's only a chance of an error, there's no
> chance of giving incorrect results.

Another option is to throw an error at parse analysis time if there is a
conflict in the specified locking policies, as in the above case.  Are
there cases in which it would make sense to have one clause trump the
other?  It seems reasonable to have NOWAIT trump regular FOR UPDATE (as
it already does), since, as you say, there's chance of error being
thrown at runtime, but not of incorrect result.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: pg_upgrade autovacuum_multixact_freeze_max_age fix
Следующее
От: Claudio Freire
Дата:
Сообщение: Re: Proposal: Incremental Backup