Re: pg_advisory_lock problem

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: pg_advisory_lock problem
Дата
Msg-id 53E8396C.5060806@hogranch.com
обсуждение исходный текст
Ответ на Re: pg_advisory_lock problem  (David G Johnston <david.g.johnston@gmail.com>)
Ответы Re: pg_advisory_lock problem  (Rémi Cura <remi.cura@gmail.com>)
Список pgsql-general
---------
>PERFORM pg_advisory_lock(#1 , 2 or 3 depending on the table#,id of the
>stuff I want to upsert) ;
>WITH stuff_to_upsert ()
>,updating AS (update returning id)
>,inserting AS (insert if not updated)
>PERFORM pg_advisory_unlock(same as above).
>--------


ah, you're releasing the lock before the insert is committed, since this
is all within a function call, its entirely within a single transaction.



--
john r pierce                                      37N 122W
somewhere on the middle of the left coast



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

Предыдущее
От: David G Johnston
Дата:
Сообщение: Re: pg_advisory_lock problem
Следующее
От: Rémi Cura
Дата:
Сообщение: Re: pg_advisory_lock problem