pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Michael Lewis <mlewis@entrata.com>
To: PostgreSQL General <pgsql-general@lists.postgresql.org>
Subject: Re: Serializable read only deferrable- implications
Date: Tue, 08 Mar 2022 17:04:57 +0100
Message-ID: <beefe50e38101af2b183fb7e04ddd252169b6e3e.camel@cybertec.at> (raw)
In-Reply-To: <CAHOFxGrrab_d3sOWy-jZWYVf=teP+u_c2KXYaZeFTqwhOrVS=A@mail.gmail.com>
References: <CAHOFxGrrab_d3sOWy-jZWYVf=teP+u_c2KXYaZeFTqwhOrVS=A@mail.gmail.com>

On Tue, 2022-03-08 at 06:29 -0700, Michael Lewis wrote:
> "The DEFERRABLE transaction property has no effect unless the transaction is also
> SERIALIZABLE and READ ONLY. When all three of these properties are selected for a transaction,
> the transaction may block when first acquiring its snapshot, after which it is able to run
> without the normal overhead of a SERIALIZABLE transaction and without any risk of contributing
> to or being canceled by a serialization failure. This mode is well suited for long-running reports or backups."
> 
> 
> Could anyone expound on the above? What are the real life differences between the two commands below? Would this be applicable at all to sessions on a physical replica?
> 
> SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL SERIALIZABLE READ ONLY DEFERRABLE;
> 
> SET SESSION CHARACTERISTICS AS TRANSACTION READ ONLY;

A transaction started with the first statement will not take any SI locks, nor
will it ever receive a serialization error.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com






view thread (9+ messages)  latest in thread

Message-ID: <beefe50e38101af2b183fb7e04ddd252169b6e3e.camel@cybertec.at>
Permalink:  ../beefe50e38101af2b183fb7e04ddd252169b6e3e.camel@cybertec.at/
Also on:    postgresql.org/message-id/beefe50e38101af2b183fb7e04ddd252169b6e3e.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, mlewis@entrata.com
  Subject: Re: Serializable read only deferrable- implications
  In-Reply-To: <beefe50e38101af2b183fb7e04ddd252169b6e3e.camel@cybertec.at>
  References: <CAHOFxGrrab_d3sOWy-jZWYVf=teP+u_c2KXYaZeFTqwhOrVS=A@mail.gmail.com> <beefe50e38101af2b183fb7e04ddd252169b6e3e.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox