Re: pl/python SPI in subtransactions - Mailing list pgsql-hackers

From Jan Urbański
Subject Re: pl/python SPI in subtransactions
Date
Msg-id 4D447AFC.5060406@wulczer.org
Whole thread Raw
In response to Re: pl/python SPI in subtransactions  (Steve Singer <ssinger_pg@sympatico.ca>)
Responses Re: pl/python SPI in subtransactions  (Steve Singer <ssinger_pg@sympatico.ca>)
List pgsql-hackers
On 29/01/11 21:27, Steve Singer wrote:
> On 11-01-27 04:33 PM, Jan Urbański wrote:
>>> I am finding the treatment of savepoints very strange.
>>> If as a function author I'm able to recover from errors then I'd expect
>>> (or maybe want) to be able to manage them through savepoints
>> Ooops, you found a bug there. In the attached patch you get the same
>> error (SPI_ERROR_TRANSACTION) as in master. Also added a unit test for
>> that.
>>
> I think you need to make the same change to PLy_spi_execute_plan.

D'oh, you're right, thanks. Attached patch with fix. Curiosly, right now
in master your example with plpy.prepare will result in "savepoint"
being swallowed, but it's of course better to react with an error.

Cheers,
Jan

Attachment

pgsql-hackers by date:

Previous
From: Steve Singer
Date:
Subject: Re: pl/python SPI in subtransactions
Next
From: Steve Singer
Date:
Subject: Re: pl/python SPI in subtransactions