How do I set the isolation level for SELECT statement?
3
votes
2
answers
2618
views
Using PostgreSQL 9.5 I would like to make sure that when I run a
SELECT
statement I get consistent results, i.e. if the table is modified while the SELECT
is running, I want to get the state that was valid when the SELECT
started.
Basically, it's like: Take a snapshot of a table, and don't allow updates to the table while the snapshot is being taken, and then deliver the snapshot, while updates are allowed again.
If I understood isolation levels correctly, REPEATABLE READ
is what I'm looking for, isn't it?
Now my question is: How can I run a SELECT
with REPEATABLE READ
isolation level? Or am I missing something, and my approach is wrong? How would I solve this?
Asked by Golo Roden
(422 rep)
Feb 4, 2016, 11:44 AM
Last activity: Aug 18, 2024, 02:04 PM
Last activity: Aug 18, 2024, 02:04 PM