Re: [GENERAL] DECLARE CURSOR - Mailing list pgsql-hackers

From Zeugswetter Andreas SB SD
Subject Re: [GENERAL] DECLARE CURSOR
Date
Msg-id 46C15C39FEB2C44BA555E356FBCD6FA4961EFC@m0114.s-mxs.net
Whole thread Raw
List pgsql-hackers
> >   is it planed cursor out of a transaction in 7.4 ?
>
> I do not think we will allow cross-transaction cursors ever.
> What would
> it mean to have a cross-transaction cursor, anyway?  Does it show a
> frozen snapshot as of the time it was opened?  The usefulness of that
> seems awfully low in comparison to the pain of implementing it.

It is usually used with comitted read isolation for an outer select
on one table and one transaction per row where the action usually involving
additional tables depends on the selected row. This is to keep transactions
small and avoid locking out other activity.

The outer cursor is declared "WITH HOLD".
I think it is a useful feature.

Of course a workaround is to open two connections.

Andreas


pgsql-hackers by date:

Previous
From: "Curtis Faith"
Date:
Subject: Re: btree shrinking again
Next
From: Tom Lane
Date:
Subject: PREPARE and parameter types (Re: [INTERFACES] DBD::PostgreSQL)