Re: TODO note - Mailing list pgsql-hackers

From Markus Wanner
Subject Re: TODO note
Date
Msg-id 4C91DD39.8070709@bluegap.ch
Whole thread Raw
In response to Re: TODO note  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Hi,

On 09/15/2010 07:30 PM, Robert Haas wrote:
> One problem with autonomous transactions is that you have to figure
> out where to store all the state associated with the autonomous
> transaction and its subtransactions.  Another is that you have to
> avoid an unacceptable slowdown in the tuple-visibility checks in the
> process.

It just occurs to me that this is the other potential use case for 
bgworkers: autonomous transactions. Simply store any kind of state in 
the bgworker and use one per autonomous transaction.

What's left to be done: implement communication between the controlling 
backend (with the client connection) and the bgworker (imessages), drop 
the bgworker's session to user privileges (and re-raise to superuser 
after the job) and implement better error handling, as those would have 
to be propagated back to the controlling backend.

Regards

Markus Wanner


pgsql-hackers by date:

Previous
From: Markus Wanner
Date:
Subject: Re: bg worker: patch 1 of 6 - permanent process
Next
From: Dimitri Fontaine
Date:
Subject: Re: autonomous transactions