Skip site navigation (1) Skip section navigation (2)

Re: pl/python SPI in subtransactions

From: Jan Urbański <wulczer(at)wulczer(dot)org>
To: Steve Singer <ssinger_pg(at)sympatico(dot)ca>
Cc: Postgres - Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pl/python SPI in subtransactions
Date: 2011-01-29 20:39:24
Message-ID: 4D447AFC.5060406@wulczer.org (view raw or flat)
Thread:
Lists: 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: plpython-spi-in-subxacts.patch
Description: text/x-patch (11.4 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Steve SingerDate: 2011-01-29 21:10:17
Subject: Re: pl/python SPI in subtransactions
Previous:From: Steve SingerDate: 2011-01-29 20:27:24
Subject: Re: pl/python SPI in subtransactions

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group