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

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: BUG #2294: SPI_connect() fails in trigger when a Foreignkey constraint exists on same table as trigger.
Дата
Msg-id 20060301185759.GA8165@surnet.cl
обсуждение исходный текст
Ответ на BUG #2294: SPI_connect() fails in trigger when a Foreignkey constraint exists on same table as trigger.  ("SPI_connect() failure." <jfitz@spacelink.com>)
Список pgsql-bugs
SPI_connect() failure. wrote:

> SPI_connect() throws "ERROR:  SPI_connect failed" message (from
> backend/utils/adt/ri_trigger.c:378) when called  from (at least) a before
> insert trigger on a table which also contains a foreign key constraint.  The
> exit from  the trigger function is inconsistent.  This error message is
> emitted from ri_trigger.c but the return result
> from SPI_connect() in the trigger is SPI_OK_CONNECT.  The insert operation
> does not commit to the database.

Do you call SPI_finish() in your trigger?  You should not leave the
SPI connection open.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

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

Предыдущее
От: "SPI_connect() failure."
Дата:
Сообщение: BUG #2294: SPI_connect() fails in trigger when a Foreignkey constraint exists on same table as trigger.
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: BUG #2292: Calling conventions in docs