Re: SPI_exec

Поиск
Список
Период
Сортировка
От Jan Wieck
Тема Re: SPI_exec
Дата
Msg-id 3D2E15A3.34BEA370@Yahoo.com
обсуждение исходный текст
Ответ на SPI_exec  ("Carmen Wai" <wai_carmen@hotmail.com>)
Список pgsql-general
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 #

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

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: how to rename an index
Следующее
От: "Susan Lane"
Дата:
Сообщение: Primary keys and NOT NULL