Re: Error handling in plperl and pltcl

From: Thomas Hallgren <thhal(at)mailblocks(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Richard Huxton <dev(at)archonet(dot)com>, Jan Wieck <JanWieck(at)Yahoo(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Error handling in plperl and pltcl
Date: 2004-11-30 21:25:00
Message-ID: thhal-0rn2IAlVJcC4+g3VK3eMeJyG+zLQnCb@mailblocks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:

>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.
>
Of course. That's why it's imperative that it is the developer that
defines the boundaries. I forsee that it will be very common that the
author wishes this to happen due to a failure of some kind. But sure,
there might be other reasons too.

>A failure in an individual
>command should not leave the function in a broken state.
>
>
Well, if the function doesn't continue, there's not much point in doing
repair work, is there? And that's the essence of the whole discussion.

You say:
Let's always take the overhead of adding a subtransaction so that the
caller will be able to return to a known state, regardless if he wants
to do so.

I say:
Let the caller decide when to add this overhead since he is the one who
knows a) when it's indeed needed at all and b) where to best define the
boundaries.

Regards,
Thomas Hallgren

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Mike Cox 2004-11-30 22:27:45 Re: [ANNOUNCE] USENET vs Mailing Lists Poll ...
Previous Message Tom Lane 2004-11-30 21:24:24 Re: Error handling in plperl and pltcl