Re: BUG #2294: SPI_connect() fails in trigger when a Foreignkey constraint exists on same table as trigger.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jim Fitzgerald" <jfitz(at)spacelink(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2294: SPI_connect() fails in trigger when a Foreignkey constraint exists on same table as trigger.
Date: 2006-03-02 15:44:33
Message-ID: 3050.1141314273@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Jim Fitzgerald" <jfitz(at)spacelink(dot)com> writes:
> It is notable, however, that Postgres is not emitting the following:
> WARNING: transaction left non-empty SPI stack
> HINT: Check for missing "SPI_finish" calls.

Well, no, because control isn't going to get that far before the
mismatched SPI_connect/SPI_finish calls are noted.

If your theory of the problem were correct then the RI triggers
themselves would cause failures whenever a table had more than one
foreign key. I feel fairly confident that it's just a bug in your
trigger code. Aside from the missing SPI_finish, you might be needing
SPI_push/SPI_pop calls if the trigger code invokes anything that might
itself call SPI.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2006-03-02 16:12:54 Re: BUG #2295: MemoryContextSwitchTo missing
Previous Message Tom Lane 2006-03-02 15:33:17 Re: BUG #2292: Calling conventions in docs