Re: autonomous transactions - Mailing list pgsql-hackers

From Greg Stark
Subject Re: autonomous transactions
Date
Msg-id CAM-w4HNrNyUaYoc3DWz8ufQKg7e1SROGiSdKpv7FQ-HgMZPEaw@mail.gmail.com
Whole thread Raw
In response to Re: autonomous transactions  (Simon Riggs <simon@2ndquadrant.com>)
Responses Re: autonomous transactions  (Serge Rielau <srielau@gmail.com>)
Re: autonomous transactions  (Craig Ringer <craig.ringer@2ndquadrant.com>)
List pgsql-hackers
On Sat, Sep 3, 2016 at 12:09 PM, Simon Riggs <simon@2ndquadrant.com> wrote:
> So doing autonomous transactions inside a single backend doesn't gain
> you very much, yet it is an enormously invasive patch to do it that
> way, not least because it requires you to rewrite locking and
> deadlocks to make them work correctly when proc is not 1:1 with xid.
> And as Serge points out it introduces other restrictions that we know
> about now, perhaps more as well.

Well using a separate process also requires rewriting locking and
deadlock detection since a reasonable user might expect that second
process to have access to data locked in their current transaction.The
plus side is that we're already facing that issue with parallel query
so at least it's something that only has to be solved once instead of
a new problem.

Parallel query is currently restricted to read-only queries however.
Autonomous transactions will certainly need to be read-write so the
question then is what problems led to the restriction in parallel
query and are they any more tractable with autonomous transactions?

-- 
greg



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Index Onlys Scan for expressions
Next
From: Michael Paquier
Date:
Subject: Re: Password identifiers, protocol aging and SCRAM protocol