Re: Question about locking

Поиск
Список
Период
Сортировка
От Ron
Тема Re: Question about locking
Дата
Msg-id d8838ea8-cc5f-854a-6e46-6ce2344d64be@gmail.com
обсуждение исходный текст
Ответ на Question about locking  (Frank Millman <frank@chagford.com>)
Ответы Re: Question about locking  (Frank Millman <frank@chagford.com>)
Список pgsql-general
On 8/7/22 00:30, Frank Millman wrote:
> Hi all
>
> Apologies if this is an FAQ, but I could not find the answer I was looking 
> for.
>
> I want to run two SELECTs, one immediately after the other.
>
> I want to ensure that no other process updates the database in between the 
> two.
>
> What is the best way to achieve this?

You probably want to put the queries in a Repeatable Read transaction, or 
even a READ ONLY serialized transaction.
https://www.postgresql.org/docs/12/transaction-iso.html#XACT-REPEATABLE-READ
https://www.postgresql.org/docs/12/transaction-iso.html#XACT-SERIALIZABLE
https://www.postgresql.org/docs/12/sql-set-transaction.html

-- 
Angular momentum makes the world go 'round.



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

Предыдущее
От: Frank Millman
Дата:
Сообщение: Question about locking
Следующее
От: Frank Millman
Дата:
Сообщение: Re: Question about locking