Repeatable Read Isolation in SQL running via background worker

Поиск
Список
Период
Сортировка
От Jeremy Finzel
Тема Repeatable Read Isolation in SQL running via background worker
Дата
Msg-id CAMa1XUiCk36+MUNWmi6xD6CFypAhH9Mmn_RJBW4vUQ0s9wsY_w@mail.gmail.com
обсуждение исходный текст
Ответы Re: Repeatable Read Isolation in SQL running via background worker
Список pgsql-hackers
I am using worker_spi as a model to run a SQL statement inside a background worker.  From my browsing of the Postgres library, I believe that if I want repeatable read isolation level, the proper way for me to attain this is to add this line after StartTransactionCommand() in worker_spi_main:

XactIsoLevel = XACT_REPEATABLE_READ;

Or - am I mistaken?  Does PushActiveSnapshot already ensure I will get the same snapshot of the data within this transaction?

Can anyone help me if this is accurate or if there are any other gotchas I should be aware of?

The SQL statement will be run every minute for example, and each time with this isolation level.  At least, that is my goal.

Any help is much appreciated.

Thanks,
Jeremy

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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Constraint documentation
Следующее
От: Nico Williams
Дата:
Сообщение: Re: [FEATURE REQUEST] Encrypted indexes over encrypted data