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>)
Список pgsql-hackers
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
Дата:
Сообщение: Re: Add LINE: hint when schemaname.typename is a non-existent schema
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: MD5 authentication needs help -SCRAM