Re: pg_try_advisory_lock is waiting?

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: pg_try_advisory_lock is waiting?
Дата
Msg-id CAHyXU0zWSgL16yqJroJHA5djr=ZwyqM94=GoOFJ2MFgzhY1_9A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: pg_try_advisory_lock is waiting?  (Mladen Gogala <gogala.mladen@gmail.com>)
Список pgsql-general
On Fri, Jan 28, 2022 at 6:34 PM Mladen Gogala <gogala.mladen@gmail.com> wrote:
>
> On 1/28/22 19:08, Tom Lane wrote:
>
> I doubt it.  I think the FOR UPDATE in the sub-select is blocked
> because the other session has an uncommitted update on the row
> it wants to lock.  This command won't reach the pg_try_advisory_lock
> call until that row lock comes free.
>
> Yes, I figured it out, but pg_try_advisory_lock returned TRUE even without "FOR UPDATE" clause in the subquery.
Shouldn'tit return false because it can't lock the row until the uncommitted update finishes?
 

advisory locks and row locks are completely distinct and separate.
It's also not a good idea to make any assumptions on order of
operations as to which lock is acquired first using subqueries in that
fashion.

merlin



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

Предыдущее
От: Ketan Popat
Дата:
Сообщение: Can one call pg_total_relation_size over foreign data wrapper?
Следующее
От: Yudianto Prasetyo
Дата:
Сообщение: Re: what is the solution like oracle DB's datafile