postgresql/src/pl/plperl
Tom Lane 1833f1a1c3 Simplify code by getting rid of SPI_push, SPI_pop, SPI_restore_connection.
The idea behind SPI_push was to allow transitioning back into an
"unconnected" state when a SPI-using procedure calls unrelated code that
might or might not invoke SPI.  That sounds good, but in practice the only
thing it does for us is to catch cases where a called SPI-using function
forgets to call SPI_connect --- which is a highly improbable failure mode,
since it would be exposed immediately by direct testing of said function.
As against that, we've had multiple bugs induced by forgetting to call
SPI_push/SPI_pop around code that might invoke SPI-using functions; these
are much harder to catch and indeed have gone undetected for years in some
cases.  And we've had to band-aid around some problems of this ilk by
introducing conditional push/pop pairs in some places, which really kind
of defeats the purpose altogether; if we can't draw bright lines between
connected and unconnected code, what's the point?

Hence, get rid of SPI_push[_conditional], SPI_pop[_conditional], and the
underlying state variable _SPI_curid.  It turns out SPI_restore_connection
can go away too, which is a nice side benefit since it was never more than
a kluge.  Provide no-op macros for the deleted functions so as to avoid an
API break for external modules.

A side effect of this removal is that SPI_palloc and allied functions no
longer permit being called when unconnected; they'll throw an error
instead.  The apparent usefulness of the previous behavior was a mirage
as well, because it was depended on by only a few places (which I fixed in
preceding commits), and it posed a risk of allocations being unexpectedly
long-lived if someone forgot a SPI_push call.

Discussion: <20808.1478481403@sss.pgh.pa.us>
2016-11-08 17:39:57 -05:00
..
expected Fix plperl to handle non-ASCII error message texts correctly. 2015-09-29 10:52:22 -04:00
po Translation updates 2016-08-08 11:08:00 -04:00
sql Fix plperl to handle non-ASCII error message texts correctly. 2015-09-29 10:52:22 -04:00
.gitignore Allow make check in PL directories 2011-02-15 06:52:12 +02:00
GNUmakefile Make hstore_plperl's build even more like plperl's 2015-05-01 22:16:58 -04:00
nls.mk Translation updates 2016-05-09 10:04:41 -04:00
plc_perlboot.pl Run newly-configured perltidy script on Perl files. 2012-07-04 21:47:49 -04:00
plc_trusted.pl Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
plperl--1.0.sql Put comments on the installable procedural languages. 2011-07-03 19:03:51 -04:00
plperl--unpackaged--1.0.sql Create extension infrastructure for the core procedural languages. 2011-03-04 21:51:14 -05:00
plperl.c Simplify code by getting rid of SPI_push, SPI_pop, SPI_restore_connection. 2016-11-08 17:39:57 -05:00
plperl.control Create extension infrastructure for the core procedural languages. 2011-03-04 21:51:14 -05:00
plperl.h Improve conversions from uint64 to Perl types. 2016-03-14 14:38:44 -04:00
plperl_helpers.h Fix plperl to handle non-ASCII error message texts correctly. 2015-09-29 10:52:22 -04:00
plperl_opmask.pl Run newly-configured perltidy script on Perl files. 2012-07-04 21:47:49 -04:00
plperlu--1.0.sql Put comments on the installable procedural languages. 2011-07-03 19:03:51 -04:00
plperlu--unpackaged--1.0.sql Create extension infrastructure for the core procedural languages. 2011-03-04 21:51:14 -05:00
plperlu.control Create extension infrastructure for the core procedural languages. 2011-03-04 21:51:14 -05:00
ppport.h Upgrade to latest ppport.h. Patch from Tim Bunce. 2009-12-25 00:24:59 +00:00
README Rename 'gmake' to 'make' in docs and recommended commands 2014-02-12 17:29:19 -05:00
SPI.xs Fix plperl to handle non-ASCII error message texts correctly. 2015-09-29 10:52:22 -04:00
text2macro.pl Run newly-configured perltidy script on Perl files. 2012-07-04 21:47:49 -04:00
Util.xs Fix plperl to handle non-ASCII error message texts correctly. 2015-09-29 10:52:22 -04:00

src/pl/plperl/README

PL/Perl allows you to write PostgreSQL functions and procedures in
Perl.  To include PL/Perl in the build use './configure --with-perl'.
To build from this directory use 'make all; make install'.  libperl
must have been built as a shared library, which is usually not the
case in standard installations.

Consult the PostgreSQL User's Guide and the INSTALL file in the
top-level directory of the source distribution for more information.