Re: SPI_prepare and error recovery

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Thomas Hallgren" <thhal(at)mailblocks(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: SPI_prepare and error recovery
Date: 2004-01-19 23:14:52
Message-ID: 19071.1074554092@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Thomas Hallgren" <thhal(at)mailblocks(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2004-01-20 00:20:45 Re: Old binary packages.
Previous Message Thomas Hallgren 2004-01-19 22:21:21 SPI_prepare and error recovery