BUG: PLPGSQL function causes PgSQL process to die when inserting into a view

Поиск
Список
Период
Сортировка
Искать

BUG: PLPGSQL function causes PgSQL process to die when inserting into a view

От:
"Christopher Travers" <einhverfr@hotmail.com>
Дата:
Hi all;

I have two tables which have different security considerations wrapped into 
a view.  Inserting into the view is done using a simple rule which inserts 
into both tables (tables have a 1:1 relationship and reflect the 
user-defined and admin-defined portions of a user profile).  From psql, 
inserts into the table work as expected.  However from a PLPGSQL function, 
any attempt to insert into the table causes the following error:

FATAL:  SPI: improper call to spi_dest_setup

The query is a simple insert and the rule merely splits it into two inserts.

The workaround is simply to insert into both tables in the view 
independently within the plpgsql function.  But this seems like odd behavior 
that should not be occurring.

Best Wishes,
Chris Travers

_________________________________________________________________
Never get a busy signal because you are always connected  with high-speed 
Internet access. Click here to comparison-shop providers.  
https://broadband.msn.com

Re: BUG: PLPGSQL function causes PgSQL process to die when

От:
Stephan Szabo <sszabo@megazone.bigpanda.com>
Дата:
On Thu, 23 Oct 2003, Christopher Travers wrote:

> Hi all;
>
> I have two tables which have different security considerations wrapped into
> a view.  Inserting into the view is done using a simple rule which inserts
> into both tables (tables have a 1:1 relationship and reflect the
> user-defined and admin-defined portions of a user profile).  From psql,
> inserts into the table work as expected.  However from a PLPGSQL function,
> any attempt to insert into the table causes the following error:
>
> FATAL:  SPI: improper call to spi_dest_setup
>
> The query is a simple insert and the rule merely splits it into two inserts.
>
> The workaround is simply to insert into both tables in the view
> independently within the plpgsql function.  But this seems like odd behavior
> that should not be occurring.

Can you give version information and a standalone example?

Re: BUG: PLPGSQL function causes PgSQL process to die when inserting into a view

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
"Christopher Travers"  writes:
> FATAL:  SPI: improper call to spi_dest_setup

I think this is a known and already-fixed bug.  What version are you
running?

			regards, tom lane
FAQ