From: Bruce Momjian <bruce@momjian.us>
To: Dave Cramer <davecramer@postgres.rocks>
Cc: Glen Huang <heyhgl@gmail.com>
Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Is replacing transactions with CTE a good idea?
Date: Thu, 1 Apr 2021 15:39:29 -0400
Message-ID: <20210401193929.GA18029@momjian.us> (raw)
In-Reply-To: <CADK3HHJ5m_dJsSsW8sLK+M9RfVWV0x42o0r8E4H1O4PtmBemiQ@mail.gmail.com>
References: <CADK3HHLzbbn0EQg_rgL8iiro-LZT6fG7rHdp_WW5uB36aJKspQ@mail.gmail.com>
<7CFF1F8C-E83D-4A68-AD89-6DD3FE2E2493@gmail.com>
<CADK3HHJ5m_dJsSsW8sLK+M9RfVWV0x42o0r8E4H1O4PtmBemiQ@mail.gmail.com>
On Thu, Apr 1, 2021 at 11:24:48AM -0400, Dave Cramer wrote:
> CTE's don't change the isolation level. I'm not sure what you are getting at
> here ?
I think what he/she means here is that all queries in a CTE use a single
snapshot, meaning you don't see changes by commits that happen between
queries that are part of the same CTE. If you were running the queries
separately in read committed mode, you would see those changes, but you
would not see them in repeatable read or serializable transaction mode.
--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com
If only the physical world exists, free will is an illusion.
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: bruce@momjian.us, davecramer@postgres.rocks, heyhgl@gmail.com
Subject: Re: Is replacing transactions with CTE a good idea?
In-Reply-To: <20210401193929.GA18029@momjian.us>
References: <CADK3HHLzbbn0EQg_rgL8iiro-LZT6fG7rHdp_WW5uB36aJKspQ@mail.gmail.com> <7CFF1F8C-E83D-4A68-AD89-6DD3FE2E2493@gmail.com> <CADK3HHJ5m_dJsSsW8sLK+M9RfVWV0x42o0r8E4H1O4PtmBemiQ@mail.gmail.com> <20210401193929.GA18029@momjian.us>
* 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