Re: Is replacing transactions with CTE a good idea? - Mailing list pgsql-general

From Glen Huang
Subject Re: Is replacing transactions with CTE a good idea?
Date
Msg-id 75F6F752-5A32-46AC-B314-28403915DBA2@gmail.com
Whole thread Raw
In response to Re: Is replacing transactions with CTE a good idea?  (Dave Cramer <davecramer@postgres.rocks>)
Responses Re: Is replacing transactions with CTE a good idea?  (Dave Cramer <davecramer@postgres.rocks>)
List pgsql-general
No, but are they equivalent to serializable transactions?

On Apr 1, 2021, at 11:04 PM, Dave Cramer <davecramer@postgres.rocks> wrote:





On Thu, 1 Apr 2021 at 10:50, Glen Huang <heyhgl@gmail.com> wrote:
Hi all,

From application’s standpoint, it seems using CTE saves a lot work. You no longer need to parse values out only to pass them back in, and only one round-trip to the db server.

If I’m not wrong, CTE is equivalent to serializable transactions? So I guess the downsize is that quarries can’t be run in parallel?

I do not think a CTE changes the isolation level. 

If I decide to replace all my transaction code with CTE, will I shoot myself in the foot down the road?


Dave Cramer
www.postgres.rocks 

pgsql-general by date:

Previous
From: Glen Huang
Date:
Subject: Re: Is replacing transactions with CTE a good idea?
Next
From: Dave Cramer
Date:
Subject: Re: Is replacing transactions with CTE a good idea?