Re: Portals and nested transactions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Portals and nested transactions
Date: 2004-07-14 19:11:54
Message-ID: 8633.1089832314@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl> writes:
> On Tue, Jul 13, 2004 at 04:57:06PM -0400, Tom Lane wrote:
>> I've been thinking about what to do with cursors in subtransactions.

> So within this proposal, a query executed by normal means will get its
> resources saved in the transaction ResourceOwner?

No, *all* queries are executed within portals. The reason we need a
transaction ResourceOwner is because query parsing/planning happens in
advance of creating the portal, so we need someplace to keep track of
resources acquired during that process.

> How is the "unnamed portal" affected by it?

Same as the rest.

I don't recall whether SPI creates actual portals, but we'd definitely
want it to create a new ResourceOwner for queries it runs.

> On the other hand, some people supported the idea that v3 Bind portals
> should behave nontransactionally, while DECLARE portals should behave
> transactionally. Maybe we could make that a property of the portal, or
> even a user-selectable property (where we would define a reasonable
> default behavior).

This is certainly possible. Whether it's a good idea needs further
discussion...

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2004-07-14 19:33:40 Re: [HACKERS] Point in Time Recovery
Previous Message Andreas Pflug 2004-07-14 19:10:09 Re: serverlog rotation/functions