[GENERAL] SPI_ERROR_CONNECT within pl/pgsql PG 8.4

2009-08-19 Thread Omar Bettin
Hello, Somebody has solved the problem that was not present in 8.3.x ? Thankyou Omar

Re: [GENERAL] SPI_ERROR_CONNECT within pl/pgsql, PG 8.4

2009-07-14 Thread Marek Lewczuk
2009/7/13 Tom Lane t...@sss.pgh.pa.us: No, you're misinterpreting the message.  What that code likely means is that something is trying to use SPI and finding plpgsql already connected.  In other words, plpgsql forgets to do a SPI_push() before calling something that might try to use SPI

Re: [GENERAL] SPI_ERROR_CONNECT within pl/pgsql, PG 8.4

2009-07-13 Thread Marek Lewczuk
2009/7/10 Tom Lane t...@sss.pgh.pa.us: Marek Lewczuk ma...@lewczuk.com writes: I have made an upgrade to PG 8.4 and following error was thrown during execution of some pl/pgsql function: ERROR:  XX000: SPI_connect failed: SPI_ERROR_CONNECT Really?  Could we see a self-contained example?

Re: [GENERAL] SPI_ERROR_CONNECT within pl/pgsql, PG 8.4

2009-07-13 Thread Tom Lane
Marek Lewczuk ne...@lewczuk.com writes: I have made an upgrade to PG 8.4 and following error was thrown during execution of some pl/pgsql function: ERROR:  XX000: SPI_connect failed: SPI_ERROR_CONNECT I can't prepare an example, cause I can't reproduce this error in an example, but in

Re: [GENERAL] SPI_ERROR_CONNECT within pl/pgsql, PG 8.4

2009-07-13 Thread Marek Lewczuk
2009/7/13 Tom Lane t...@sss.pgh.pa.us: No, you're misinterpreting the message.  What that code likely means is that something is trying to use SPI and finding plpgsql already connected.  In other words, plpgsql forgets to do a SPI_push() before calling something that might try to use SPI

[GENERAL] SPI_ERROR_CONNECT within pl/pgsql, PG 8.4

2009-07-10 Thread Marek Lewczuk
Hello, I have made an upgrade to PG 8.4 and following error was thrown during execution of some pl/pgsql function: ERROR: XX000: SPI_connect failed: SPI_ERROR_CONNECT CONTEXT: PL/pgSQL function price_aftertrigger line 30 at IF SQL statement update price set validFrom = $1 , validTo = $2

Re: [GENERAL] SPI_ERROR_CONNECT within pl/pgsql, PG 8.4

2009-07-10 Thread Tom Lane
Marek Lewczuk ma...@lewczuk.com writes: I have made an upgrade to PG 8.4 and following error was thrown during execution of some pl/pgsql function: ERROR: XX000: SPI_connect failed: SPI_ERROR_CONNECT Really? Could we see a self-contained example? regards, tom lane

Re: [GENERAL] SPI_ERROR_CONNECT in plperl function

2009-01-08 Thread Christian Schröder
Tom Lane wrote: Hmph ... looks like plperl is shy a few SPI_push/SPI_pop calls. I've applied a patch for this --- it'll be in the next set of update releases. Great. Thanks a lot! The whole PostgreSQL stuff is really amazing! :-) Regards, Christian -- Deriva GmbH

Re: [GENERAL] SPI_ERROR_CONNECT in plperl function

2009-01-07 Thread Tom Lane
I wrote: =?ISO-8859-1?Q?Christian_Schr=F6der?= c...@deriva.de writes: When I try to call the function I get the following error message: test=# select * from testfunc(); ERROR: error from Perl function: SPI_connect failed: SPI_ERROR_CONNECT at line 2. Hmph ... looks like plperl is shy a

[GENERAL] SPI_ERROR_CONNECT in plperl function

2009-01-04 Thread Christian Schröder
Hi list, I have found the following problem: I have declared a domain datatype with a check constraint. The check constraint uses a plpgsql function: CREATE FUNCTION domain_ok(value integer) RETURNS boolean AS $$ BEGIN RETURN value 0; END; $$ LANGUAGE plpgsql; CREATE DOMAIN testdomain

Re: [GENERAL] SPI_ERROR_CONNECT in plperl function

2009-01-04 Thread Tom Lane
=?ISO-8859-1?Q?Christian_Schr=F6der?= c...@deriva.de writes: When I try to call the function I get the following error message: test=# select * from testfunc(); ERROR: error from Perl function: SPI_connect failed: SPI_ERROR_CONNECT at line 2. Hmph ... looks like plperl is shy a few

[GENERAL] SPI_ERROR_CONNECT

2008-02-11 Thread Willem Buitendyk
I am receiving a SPI_ERROR_CONNECT error. From what I'm reading I could fix this in C using SPI_push(). How does one fix this with PL/PGSql? Return error: --- NOTICE: current day = 1 ERROR:

Re: [GENERAL] SPI_ERROR_CONNECT

2008-02-11 Thread Tom Lane
Willem Buitendyk [EMAIL PROTECTED] writes: ERROR: SPI_connect failed: SPI_ERROR_CONNECT CONTEXT: PL/pgSQL function pop_tag_day_over line 17 at FOR over SELECT rows Hm, what PG version is this? And could we have a complete test case not just the function? (I don't feel like trying to

Re: [GENERAL] SPI_ERROR_CONNECT

2008-02-11 Thread Willem Buitendyk
Tom Lane wrote: That's a fairly bad workaround (assuming that the function is a legitimate candidate to be IMMUTABLE) because it defeats potential optimizations. What I'd suggest you do instead is rethink your apparently widespread habit of whacking your view definitions around

Re: [GENERAL] SPI_ERROR_CONNECT

2008-02-11 Thread Willem Buitendyk
The problem was with the following: FOR current_row IN SELECT * from temp_tags_18_counted The select from the [temp_tags_18_counted] view is made up of 3 cross joins. When I simplify and remove the joins everything works. I tried this with some test data with only a few rows

Re: [GENERAL] SPI_ERROR_CONNECT

2008-02-11 Thread Willem Buitendyk
Thanks Tom, I sent you a test case. The problem has since been resolved by changing one of my functions to VOLATILE instead of IMMUTABLE. This has caught me twice now in the last few days. I hope my learning of this will be a little more IMMUTABLE :) cheers, willem PG 8.3 Tom Lane

Re: [GENERAL] SPI_ERROR_CONNECT

2008-02-11 Thread Tom Lane
Willem Buitendyk [EMAIL PROTECTED] writes: The problem was with the following: FOR current_row IN SELECT * from temp_tags_18_counted The select from the [temp_tags_18_counted] view is made up of 3 cross joins. When I simplify and remove the joins everything works. I tried

Re: [GENERAL] SPI_ERROR_CONNECT

2008-02-11 Thread Tom Lane
Willem Buitendyk [EMAIL PROTECTED] writes: I sent you a test case. Thanks for the test case --- I've committed a patch: http://archives.postgresql.org/pgsql-committers/2008-02/msg00108.php The problem has since been resolved by changing one of my functions to VOLATILE instead of IMMUTABLE.