Re: Is this a reasonable use for advisory locks?

Поиск
Список
Период
Сортировка
От Nick Cleaton
Тема Re: Is this a reasonable use for advisory locks?
Дата
Msg-id CAFgz3kvn0uh+Cpv4sXtnM8Oiyp0ztit2zoY=13saX_8p-piSbQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Is this a reasonable use for advisory locks?  (Steve Baldwin <steve.baldwin@gmail.com>)
Ответы Re: Is this a reasonable use for advisory locks?  (Perryn Fowler <perryn@fresho.com>)
Список pgsql-general
On Thu, 14 Apr 2022 at 10:47, Steve Baldwin <steve.baldwin@gmail.com> wrote:
Ok, so you want to allow _other_ updates to a customer while this process is happening? In that case, advisory locks will probably work. The only consideration is that the 'id' is a bigint. If your customer id maps to that, great. If not (for example we use UUID's), you will need some way to convert that id to a bigint.

Alternatively, create a new table that records the start timestamp of the most recent run of your code block for each customer, and update that as the first action in your transaction. Then row locks on that table will protect you from concurrent runs.

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

Предыдущее
От: Steve Baldwin
Дата:
Сообщение: Re: Is this a reasonable use for advisory locks?
Следующее
От: Jan Beseda
Дата:
Сообщение: ERROR: XX000: cache lookup failed for type 75083631