Re: Error handling in plperl and pltcl - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Error handling in plperl and pltcl
Date
Msg-id 24061.1101846803@sss.pgh.pa.us
Whole thread Raw
In response to Re: Error handling in plperl and pltcl  (Thomas Hallgren <thhal@mailblocks.com>)
Responses Re: Error handling in plperl and pltcl  (Thomas Hallgren <thhal@mailblocks.com>)
List pgsql-hackers
Thomas Hallgren <thhal@mailblocks.com> writes:
>  From your statement it sounds like you want to use the subtransactions 
> solely in a hidden mechanism and completely remove the ability to use 
> them from the function developer. Is that a correct interpretation?

No; I would like to develop the ability to specify savepoints in pltcl
and plperl, so that already-executed SPI commands can be rolled back at
need.  But that is a feature for later --- it's way too late to think
about it for 8.0.  Moreover, having that will not remove the requirement
for the state after catching a SPI error to be sane.

The fundamental point you are missing, IMHO, is that a savepoint is a
mechanism for rolling back *already executed* SPI commands when the
function author wishes that to happen.  A failure in an individual
command should not leave the function in a broken state.
        regards, tom lane


pgsql-hackers by date:

Previous
From: alex yap
Date:
Subject: createdb failed
Next
From: James William Pye
Date:
Subject: Re: Error handling in plperl and pltcl