Re: SPI_ERROR_CONNECT within pl/pgsql, PG 8.4

From: Marek Lewczuk <marek(at)lewczuk(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PGSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: SPI_ERROR_CONNECT within pl/pgsql, PG 8.4
Date: 2009-07-14 11:49:32
Message-ID: daadfdc20907140449t3169b6b8x6b4f2e5bd9ddf1ed@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2009/7/13 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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-entrantly.  It should be
> perfectly deterministic and it definitely doesn't have anything to do
> with the states of other sessions.  But we're going to need a test
> case to fix it.
>
Tom,
I'm not able to prepare a test case - the error is thrown exactly in
two queries, but those queries can be executed without that error -
there is no rule, when it will be thrown. When the error was thrown
both queries cannot be executed (in the same connection of course, but
in other connections they can be executed without problem). Before the
error is thrown both queries were executed successfully (I'm logging
all "mod" queries), but at some moment (unknown for me) the error is
thrown and as I wrote those queries cannot be executed in current
connection anymore - what is really strange is the fact that other
queries (both selects and updates) can be executed in that connection
and there some of those queries fires plpgsql triggers which updates
db data (so SPI is used??).

What can I do ? I don't want to do the downgrade :-( How can I track
the moment, when plpgsql forgets to do SPI_push() ?

I'm really appreciated for your help.

ML

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stuart Bishop 2009-07-14 12:00:22 Connection pool/load balancer supporting ident authentication?
Previous Message Ransika de Silva 2009-07-14 11:34:07 Re: [Q] single image Table across multiple PG servers