Re: Error handling in plperl and pltcl

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Error handling in plperl and pltcl
Дата
Msg-id 5751.1101786190@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Error handling in plperl and pltcl  (Jan Wieck <JanWieck@Yahoo.com>)
Ответы Re: Error handling in plperl and pltcl  (Jan Wieck <JanWieck@Yahoo.com>)
Re: Error handling in plperl and pltcl  (Richard Huxton <dev@archonet.com>)
Список pgsql-hackers
Jan Wieck <JanWieck@Yahoo.com> writes:
> I don't agree that the right cure is to execute each and every statement 
> itself as a subtransaction. What we ought to do is to define a wrapper 
> for the catch Tcl command, that creates a subtransaction and executes 
> the code within during that.

What I would like to do is provide a catch-like Tcl command that defines
a subtransaction, and then optimize the SPI commands so that they don't
create their own sub-subtransaction if they can see they are directly
within the subtransaction command.  But when they aren't, they need to
define their own subtransactions so that the error semantics are
reasonable.  I think what you're saying is that a catch command should
be exactly equivalent to a subtransaction, but I'm unconvinced --- a
catch might be used around some Tcl operations that don't touch the
database, in which case the subtransaction overhead would be a serious
waste.

The real point here is that omitting the per-command subtransaction
ought to be a hidden optimization, not something that intrudes to the
point of having unclean semantics when we can't do it.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: multiline CSV fields
Следующее
От: Robert Treat
Дата:
Сообщение: Re: bug fix request