dbTalk Databases Forums  

[BUGS] BUG #2836: SPI_execute_plan failed on pl/pgsql function that worked on 8.1

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #2836: SPI_execute_plan failed on pl/pgsql function that worked on 8.1 in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Albert Cervera i Areny
 
Posts: n/a

Default [BUGS] BUG #2836: SPI_execute_plan failed on pl/pgsql function that worked on 8.1 - 12-18-2006 , 04:24 PM







The following bug has been logged online:

Bug reference: 2836
Logged by: Albert Cervera i Areny
Email address: albert (AT) sedifa (DOT) com
PostgreSQL version: 8.2
Operating system: Debian GNU/Linux
Description: SPI_execute_plan failed on pl/pgsql function that worked
on 8.1
Details:

I get the following error on a function that worked correctly on 8.1:

ERROR: SPI_execute_plan failed executing query "UPDATE
pg_catalog.pg_settings SET setting= $1 WHERE name='search_path'":
Unrecognized SPI code 0
CONTEXT: PL/pgSQL function "ventas_por_grupo_conjunta_tmp" line 23 at SQL
statement
SQL function "ventas_por_grupo_conjunta" statement 1

The function tries to reestablish the search_path with the following UPDATE
command:

$body$
SELECT setting INTO path FROM pg_catalog.pg_settings WHERE
name='search_path';

....here the rest of the function...

UPDATE pg_catalog.pg_settings SET setting=path WHERE name='search_path
$body$

I've been able to work around this by using:

EXECUTE 'UPDATE pg_catalog.pg_settings SET setting=''' || path || ''' WHERE
name=''search_path''';

instead.

Hope this helps in finding out the problem. I don't think the behaviour is
intended.

Please, contact if you want me to test any patches.

Thanks!

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] BUG #2836: SPI_execute_plan failed on pl/pgsql function that worked on 8.1 - 12-26-2006 , 10:58 AM






"Albert Cervera i Areny" <albert (AT) sedifa (DOT) com> writes:
Quote:
I get the following error on a function that worked correctly on 8.1:

ERROR: SPI_execute_plan failed executing query "UPDATE
pg_catalog.pg_settings SET setting= $1 WHERE name='search_path'":
Unrecognized SPI code 0
Fixed, thanks for the report!

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.