OSDN Git Service

Make use of plancache module for SPI plans. In particular, since plpgsql
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 15 Mar 2007 23:12:07 +0000 (23:12 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 15 Mar 2007 23:12:07 +0000 (23:12 +0000)
commit95f6d2d20921b7c2dbec29bf2706fd9448208aa6
tree21dcb36f9df60546d82d547a7855605be73a771c
parentd3ff180163a0c88d7a05e0c865f649e5d8bcd6e1
Make use of plancache module for SPI plans.  In particular, since plpgsql
uses SPI plans, this finally fixes the ancient gotcha that you can't
drop and recreate a temp table used by a plpgsql function.

Along the way, clean up SPI's API a little bit by declaring SPI plan
pointers as "SPIPlanPtr" instead of "void *".  This is cosmetic but
helps to forestall simple programming mistakes.  (I have changed some
but not all of the callers to match; there are still some "void *"'s
in contrib and the PL's.  This is intentional so that we can see if
anyone's compiler complains about it.)
16 files changed:
contrib/spi/refint.c
contrib/spi/timetravel.c
doc/src/sgml/spi.sgml
src/backend/executor/spi.c
src/backend/utils/adt/ri_triggers.c
src/backend/utils/adt/ruleutils.c
src/backend/utils/adt/xml.c
src/backend/utils/cache/plancache.c
src/include/executor/spi.h
src/include/executor/spi_priv.h
src/include/utils/plancache.h
src/pl/plpgsql/src/pl_exec.c
src/pl/plpgsql/src/plpgsql.h
src/test/regress/expected/plancache.out
src/test/regress/regress.c
src/test/regress/sql/plancache.sql