From: | Eric Ridge <ebr(at)tcdi(dot)com> |
---|---|
To: | Joe Conway <mail(at)joeconway(dot)com> |
Cc: | Pgsql-General <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Cursors and Transactions, why? |
Date: | 2004-04-05 22:52:48 |
Message-ID: | F5B488D6-8753-11D8-91AB-000A95BB5944@tcdi.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Apr 5, 2004, at 6:44 PM, Joe Conway wrote:
> Eric Ridge wrote:
>> Why must a cursor be defined in an open transaction? Obviously
>> there's a good reason, but I can't figure it out. On a high level,
>> what would be involved in allowing a cursor to outlive the
>> transaction that created it?
>
> Historically I think it was because the memory was released at the end
> of the current transaction (i.e. allocations were made in
> TopTransactionContext). But as of 7.4, cursors *can* outlive
> transactions:
> http://www.postgresql.org/docs/current/interactive/sql-declare.html
>
> WITH HOLD
> WITHOUT HOLD
holy cow! This is fantastic. I had no idea. <short pause> ooh, and
I see FETCH, in 7.4, supports absolute positioning. Must upgrade.
thanks!
eric
From | Date | Subject | |
---|---|---|---|
Next Message | William White | 2004-04-05 22:59:33 | Re: left and overleft/notright revisited: why !>> and !<< |
Previous Message | Joe Conway | 2004-04-05 22:44:51 | Re: Cursors and Transactions, why? |