Re: Transaction isolation level Repeatable Read Read Only vs Serializable Read Only

From: Jan Behrens <jbe-mlist(at)magnetkern(dot)de>
To: Mohamed Wael Khobalatte <mkhobalatte(at)grubhub(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Transaction isolation level Repeatable Read Read Only vs Serializable Read Only
Date: 2020-11-27 01:19:11
Message-ID: 20201127021911.73283b9cf15eed1b4bc9eded@magnetkern.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 26 Nov 2020 19:13:53 -0500
Mohamed Wael Khobalatte <mkhobalatte(at)grubhub(dot)com> wrote:

> >
> > Thus, what does SERIALIZABLE READ ONLY achieve that REPEATABLE READ READ
> > ONLY does not? And what is SERIALIZABLE READ ONLY DEFERRABLE for?
> >
>
> There is a nice walkthrough of the "control" and "batches/details" scenario
> mentioned in the docs, you can find it in the wiki,
> <https://wiki.postgresql.org/wiki/SSI#Deposit_Report> and I think it
> explains the difference well.

Thank you, it helped me a lot.

If there are two REPEATABLE READ READ WRITE transactions, which do *not* require SERIALIZABLE isolation, there could still be a third READ ONLY transaction, which has stricter requirements on isolation when retrieving data. SERIALIZABLE READ ONLY will fail under certain circumstances in which case the retrieved information should be deemed void and re-requested in a new transaction in order to fit the extra requirements on isolation of the read-only transaction.

Then "DEFERRABLE" makes sense too, as it will make the third transaction block for a certain time instead of risking cancellation.

Thanks
Jan

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2020-11-27 04:24:04 Re: Transaction isolation level Repeatable Read Read Only vs Serializable Read Only
Previous Message Mohamed Wael Khobalatte 2020-11-27 00:13:53 Re: Transaction isolation level Repeatable Read Read Only vs Serializable Read Only