Обсуждение: SPI_exec

Поиск
Список
Период
Сортировка

SPI_exec

От
"Carmen Wai"
Дата:
Hello:

How can I use the spi_exec in PL/TCL to retrieve the return error code?

Carmen

_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com




Re: SPI_exec

От
Jan Wieck
Дата:
Carmen Wai wrote:
>
> Hello:
>
> How can I use the spi_exec in PL/TCL to retrieve the return error code?

Maybe I don't understand completely, but if you execute a query
via spi_exec that results in an ERROR, control never returns into
PL/Tcl (or any other procedural language for that matter).
PostgreSQL does not support error catching yet.

In the PL/Tcl case it does return and you could theoretically
catch it. But there isn't much you can do from there, because
your transaction is already irrevocable in abort state and all
future calls to any spi_* function will result in an error
return. That it does return this way is just to cleanly unwind
the call hirarchy with the Tcl interpreter.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being
right. #
# Let's break this rule - forgive
me.                                  #
#==================================================
JanWieck@Yahoo.com #