Re: SPI_prepare and error recovery - Mailing list pgsql-hackers

From Tom Lane
Subject Re: SPI_prepare and error recovery
Date
Msg-id 19071.1074554092@sss.pgh.pa.us
Whole thread Raw
In response to SPI_prepare and error recovery  ("Thomas Hallgren" <thhal@mailblocks.com>)
List pgsql-hackers
"Thomas Hallgren" <thhal@mailblocks.com> writes:
> My question is, at the point of /* Handle error here */, how do I get hold
> of the error information?

You don't.  The above coding technique is entirely unsafe anyway,
because it relies on the assumption that the system is still in a good
state to continue the transaction, which is in general not true.

If we had nested-transaction support you could arrange for an inner
transaction around the thing you want to retry; but we don't, and this
problem of cleaning up after an error is one of the biggest reasons
why not.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Thomas Hallgren"
Date:
Subject: SPI_prepare and error recovery
Next
From: Peter Eisentraut
Date:
Subject: Re: Old binary packages.