Skip site navigation (1) Skip section navigation (2)

pgsql: Do a conditional SPI_push/SPI_pop when replanning a query in

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Do a conditional SPI_push/SPI_pop when replanning a query in
Date: 2009-07-14 15:37:55
Message-ID: 20090714153755.BAD6C75331E@cvs.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
Do a conditional SPI_push/SPI_pop when replanning a query in
RevalidateCachedPlan.  This is to avoid a "SPI_ERROR_CONNECT" failure when
the planner calls a SPI-using function and we are already inside one.
The alternative fix is to expect callers of RevalidateCachedPlan to do this,
which seems likely to result in additional hard-to-detect bugs of omission.
Per reports from Frank van Vugt and Marek Lewczuk.

Back-patch to 8.3. It's much harder to trigger the bug in 8.3, due to a
smaller set of cases in which plans can be invalidated, but it could happen.
(I think perhaps only a SI reset event could make 8.3 fail here, but that's
certainly within the realm of possibility.)

Tags:
----
REL8_4_STABLE

Modified Files:
--------------
    pgsql/src/backend/utils/cache:
        plancache.c (r1.27 -> r1.27.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/cache/plancache.c?r1=1.27&r2=1.27.2.1)

pgsql-committers by date

Next:From: Tom LaneDate: 2009-07-14 15:38:03
Subject: pgsql: Do a conditional SPI_push/SPI_pop when replanning a query in
Previous:From: Tom LaneDate: 2009-07-14 15:37:50
Subject: pgsql: Do a conditional SPI_push/SPI_pop when replanning a query in

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group