Re: cursors outside transactions - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: cursors outside transactions
Date
Msg-id 20030318033731.GA9712@dcc.uchile.cl
Whole thread Raw
In response to Re: cursors outside transactions  (Neil Conway <neilc@samurai.com>)
List pgsql-hackers
On Mon, Mar 17, 2003 at 10:26:07PM -0500, Neil Conway wrote:
> On Mon, 2003-03-17 at 22:01, Alvaro Herrera wrote:
> > What about opening a pseudo-transaction that exists only to serve the
> > cursor?
> 
> What exactly do you mean by a pseudo-transaction?

Assign an xid, create the transaction (create a pg_clog entry), open the
cursor using that xid, and put that xid into some table so it can be
ended when the cursor is closed.  That's why I said you'll probably need
to access the lowlevel routines for transactions.  OTOH I can hear
objections to that idea right now...

> Keep in mind we don't have nested transactions (yet?),

I'm looking at the issues about this.  I don't think that facility will
help you, since you have to end the inner transactions before you end
the outer ones.  That is, you can't create a normal subtransaction to
hold the cursor and expect it to live longer than the outer one.

-- 
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
Oh, oh, las chicas galacianas, lo harán por las perlas,
¡Y las de Arrakis por el agua! Pero si buscas damas
Que se consuman como llamas, ¡Prueba una hija de Caladan! (Gurney Halleck)


pgsql-hackers by date:

Previous
From: Neil Conway
Date:
Subject: Re: cursors outside transactions
Next
From: Neil Conway
Date:
Subject: Re: [INTERFACES] Roadmap for FE/BE protocol redesign