Re: Cursors and Transactions, why? - Mailing list pgsql-general

From Tom Lane
Subject Re: Cursors and Transactions, why?
Date
Msg-id 6930.1081388801@sss.pgh.pa.us
Whole thread Raw
In response to Re: Cursors and Transactions, why?  (Eric Ridge <ebr@tcdi.com>)
List pgsql-general
Eric Ridge <ebr@tcdi.com> writes:
> wow.  I should go back and read the archives to see if this was
> discussed already, but I can't help but wonder if there's a way to only
> copy pointers to the tuples.  I realize VACUUM could screw it up, but
> maybe something could be invented (or re-used) to help guard against
> that.

Still looking for that free lunch, eh?

If you want to leave the tuples on-disk, then you hold a transaction
open to ensure that VACUUM won't whisk them out from under you.  That's
what the normal non-HOLD cursor case will do.

If you don't want to leave the tuples on-disk, you have to copy them
someplace.  You can do that with a HOLD cursor.

AFAICS any other solution will simply reinvent one or the other of these
techniques.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: How to list domains
Next
From: Mage
Date:
Subject: eval in plpgsl