Thread: pgsql: Wrap PL/Python SPI calls into subtransactions

pgsql: Wrap PL/Python SPI calls into subtransactions

From
Peter Eisentraut
Date:
Wrap PL/Python SPI calls into subtransactions

This allows the language-specific try/catch construct to catch and
handle exceptions arising from SPI calls, matching the behavior of
other PLs.

As an additional bonus you no longer get all the ugly "unrecognized
error in PLy_spi_execute_query" errors.

Jan Urbański, reviewed by Steve Singer

Branch
------
master

Details
-------
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=0c5933d0104c1788479592a84cca53da357381f9

Modified Files
--------------
doc/src/sgml/plpython.sgml                    |   30 ++++++
src/pl/plpython/expected/plpython_error.out   |   32 +++++--
src/pl/plpython/expected/plpython_error_0.out |   32 +++++--
src/pl/plpython/plpython.c                    |  118 ++++++++++++++++++++++---
src/pl/plpython/sql/plpython_error.sql        |   22 +++++
5 files changed, 202 insertions(+), 32 deletions(-)


Re: pgsql: Wrap PL/Python SPI calls into subtransactions

From
Andrew Dunstan
Date:

On 02/02/2011 03:09 PM, Peter Eisentraut wrote:
> Wrap PL/Python SPI calls into subtransactions
>
> This allows the language-specific try/catch construct to catch and
> handle exceptions arising from SPI calls, matching the behavior of
> other PLs.
>
> As an additional bonus you no longer get all the ugly "unrecognized
> error in PLy_spi_execute_query" errors.
>
>


We seem to have major buildfarm breakage from this.

cheers

andrew

Re: pgsql: Wrap PL/Python SPI calls into subtransactions

From
Tom Lane
Date:
Andrew Dunstan <andrew@dunslane.net> writes:
> On 02/02/2011 03:09 PM, Peter Eisentraut wrote:
>> Wrap PL/Python SPI calls into subtransactions

> We seem to have major buildfarm breakage from this.

Looks like Peter forgot again to check plpython_unicode_3.out.
I imagine he's gone to bed by now, so I pushed a fix.

Not all the red is Peter's fault though :-(

            regards, tom lane