Re: SPI_exec

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Carmen Wai <wai_carmen(at)hotmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: SPI_exec
Date: 2002-07-11 23:32:51
Message-ID: 3D2E15A3.34BEA370@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)Yahoo(dot)com #

In response to

  • SPI_exec at 2002-07-09 00:01:01 from Carmen Wai

Browse pgsql-general by date

  From Date Subject
Next Message Susan Lane 2002-07-11 23:50:19 Primary keys and NOT NULL
Previous Message Jie Liang 2002-07-11 23:26:43 Re: [SQL] Please, HELP! Why is the query plan so wrong???