Re: nested SQL with SPI

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Markus Wagner <wagner(at)imsd(dot)uni-mainz(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: nested SQL with SPI
Date: 2001-09-03 19:16:31
Message-ID: 5864.999544591@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Markus Wagner <wagner(at)imsd(dot)uni-mainz(dot)de> writes:
> can I nest SQL statements with SPI within trigger functions?
> How can I distinguish the results in SPI_tuptable?

Yes, but remember that SPI_tuptable is just a global variable. What
you'll probably need to do is copy it and associated globals into locals
of your function as soon as SPI_exec returns, and then use the local
values to access that result. In this way, nested executions of
SPI_exec won't confuse your access to your result.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message postgres 2001-09-03 19:27:27 Re: Perl won't eval PgSQL boolean value
Previous Message bpalmer 2001-09-03 19:13:25 Re: SHOW