pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Use LOAD not actual code execution to pull in plpython library. 2+ messages / 1 participants [nested] [flat]
* pgsql: Use LOAD not actual code execution to pull in plpython library. @ 2016-01-12 01:06 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2016-01-12 01:06 UTC (permalink / raw) To: pgsql-committers Use LOAD not actual code execution to pull in plpython library. Commit 866566a690bb9916 is insufficient to prevent dump/reload failures when using transform modules in a database with both plpython2 and plpython3 installed. The reason is that the transform extension scripts use DO blocks as a mechanism to pull in the libpython library before creating the transform function. It's necessary to preload the library because the dynamic loader won't do it for us on every platform, leading to "unresolved symbol" failures when the transform library is loaded. But it's *not* necessary to execute Python code, and doing so will provoke a multiple-Pythons-are-loaded error even after the preceding commit. To fix, use LOAD instead of a DO block. That requires superuser privilege, but creation of a C function does anyway. It also embeds knowledge of the underlying library name for each PL language; but that's wired into the initdb-time contents of pg_pltemplate too, so that doesn't seem like a large problem either. Note that CREATE TRANSFORM as such doesn't call the language module at all. Per a report from Paul Jones. Back-patch to 9.5 where transform modules were introduced. Branch ------ master Details ------- http://git.postgresql.org/pg/commitdiff/fb6fcbd33fbbd6d31fa2b39938e60ecb48dc4de4 Modified Files -------------- contrib/hstore_plperl/hstore_plperl--1.0.sql | 2 +- contrib/hstore_plperl/hstore_plperlu--1.0.sql | 2 +- contrib/hstore_plpython/hstore_plpython2u--1.0.sql | 2 +- contrib/hstore_plpython/hstore_plpython3u--1.0.sql | 2 +- contrib/hstore_plpython/hstore_plpythonu--1.0.sql | 2 +- contrib/ltree_plpython/ltree_plpython2u--1.0.sql | 2 +- contrib/ltree_plpython/ltree_plpython3u--1.0.sql | 2 +- contrib/ltree_plpython/ltree_plpythonu--1.0.sql | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Use LOAD not actual code execution to pull in plpython library. @ 2016-01-12 01:06 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2016-01-12 01:06 UTC (permalink / raw) To: pgsql-committers Use LOAD not actual code execution to pull in plpython library. Commit 866566a690bb9916 is insufficient to prevent dump/reload failures when using transform modules in a database with both plpython2 and plpython3 installed. The reason is that the transform extension scripts use DO blocks as a mechanism to pull in the libpython library before creating the transform function. It's necessary to preload the library because the dynamic loader won't do it for us on every platform, leading to "unresolved symbol" failures when the transform library is loaded. But it's *not* necessary to execute Python code, and doing so will provoke a multiple-Pythons-are-loaded error even after the preceding commit. To fix, use LOAD instead of a DO block. That requires superuser privilege, but creation of a C function does anyway. It also embeds knowledge of the underlying library name for each PL language; but that's wired into the initdb-time contents of pg_pltemplate too, so that doesn't seem like a large problem either. Note that CREATE TRANSFORM as such doesn't call the language module at all. Per a report from Paul Jones. Back-patch to 9.5 where transform modules were introduced. Branch ------ REL9_5_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/5ef26b8de3a12b0766334a19665d8b0f494a6af8 Modified Files -------------- contrib/hstore_plperl/hstore_plperl--1.0.sql | 2 +- contrib/hstore_plperl/hstore_plperlu--1.0.sql | 2 +- contrib/hstore_plpython/hstore_plpython2u--1.0.sql | 2 +- contrib/hstore_plpython/hstore_plpython3u--1.0.sql | 2 +- contrib/hstore_plpython/hstore_plpythonu--1.0.sql | 2 +- contrib/ltree_plpython/ltree_plpython2u--1.0.sql | 2 +- contrib/ltree_plpython/ltree_plpython3u--1.0.sql | 2 +- contrib/ltree_plpython/ltree_plpythonu--1.0.sql | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2016-01-12 01:06 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2016-01-12 01:06 pgsql: Use LOAD not actual code execution to pull in plpython library. Tom Lane <tgl@sss.pgh.pa.us> 2016-01-12 01:06 pgsql: Use LOAD not actual code execution to pull in plpython library. Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox