Re: Left lateral join with for update and skip locked

Поиск
Список
Период
Сортировка
Искать
От
Alvaro Herrera
Тема
Re: Left lateral join with for update and skip locked
Дата
Msg-id
20150318131523.GU3636@alvh.no-ip.org
Ответ на
Список
Дерево обсуждения
Left lateral join with for update and skip locked Benjamin Börngen-Schmidt<benjamin@boerngen-schmidt.de>
Re: Left lateral join with for update and skip locked Tom Lane <tgl@sss.pgh.pa.us>
Re: Left lateral join with for update and skip locked Alvaro Herrera <alvherre@2ndquadrant.com>
Benjamin Börngen-Schmidt wrote:

> The Lateral statement does return a result, which I do not expect. I returns
> an end point multiple times for diverent start points. Why? I thought, that
> the selected point by the lateral is locked by the FOR UPDATE and if the
> lateral selects a point that is already locked it will be skipped by the
> SKIP LOCKED.

So you want the LATERAL to lock a row, such that that row is not
returned by the "s" arm of the left join in the same query because of
SKIP LOCKED?  That seems flawed to me: the row lock is considered
automatically granted if the would-be locker is the same transaction as
the lock holder.

I am too lazy to reverse engineer your schema.  Are de_sim_points_end
and de_sim_points_start views on the same table(s), or something like
that?

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


В списке pgsql-hackers по дате отправления
От: Alvaro Herrera
Дата:
От: Alvaro Herrera
Дата:
FAQ