Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfb6fcbd

Browse files
committed
Use LOAD not actual code execution to pull in plpython library.
Commit866566a is insufficient to prevent dump/reload failureswhen using transform modules in a database with both plpython2 andplpython3 installed. The reason is that the transform extension scriptsuse DO blocks as a mechanism to pull in the libpython library beforecreating the transform function. It's necessary to preload the librarybecause the dynamic loader won't do it for us on every platform, leadingto "unresolved symbol" failures when the transform library is loaded.But it's *not* necessary to execute Python code, and doing so willprovoke a multiple-Pythons-are-loaded error even after the precedingcommit.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 ofthe underlying library name for each PL language; but that's wired intothe initdb-time contents of pg_pltemplate too, so that doesn't seem likea large problem either. Note that CREATE TRANSFORM as such doesn't callthe language module at all.Per a report from Paul Jones. Back-patch to 9.5 where transform moduleswere introduced.
1 parent866566a commitfb6fcbd

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

‎contrib/hstore_plperl/hstore_plperl--1.0.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- make sure the prerequisite libraries are loaded
2-
DO'' LANGUAGEplperl;
2+
LOAD'plperl';
33
SELECTNULL::hstore;
44

55

‎contrib/hstore_plperl/hstore_plperlu--1.0.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- make sure the prerequisite libraries are loaded
2-
DO'' LANGUAGE plperlu;
2+
LOAD'plperl';
33
SELECTNULL::hstore;
44

55

‎contrib/hstore_plpython/hstore_plpython2u--1.0.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- make sure the prerequisite libraries are loaded
2-
DO'1' LANGUAGE plpython2u;
2+
LOAD'plpython2';
33
SELECTNULL::hstore;
44

55

‎contrib/hstore_plpython/hstore_plpython3u--1.0.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- make sure the prerequisite libraries are loaded
2-
DO'1' LANGUAGE plpython3u;
2+
LOAD'plpython3';
33
SELECTNULL::hstore;
44

55

‎contrib/hstore_plpython/hstore_plpythonu--1.0.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- make sure the prerequisite libraries are loaded
2-
DO'1' LANGUAGE plpythonu;
2+
LOAD'plpython2';-- change to plpython3 if that ever becomes the default
33
SELECTNULL::hstore;
44

55

‎contrib/ltree_plpython/ltree_plpython2u--1.0.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- make sure the prerequisite libraries are loaded
2-
DO'1' LANGUAGE plpython2u;
2+
LOAD'plpython2';
33
SELECTNULL::ltree;
44

55

‎contrib/ltree_plpython/ltree_plpython3u--1.0.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- make sure the prerequisite libraries are loaded
2-
DO'1' LANGUAGE plpython3u;
2+
LOAD'plpython3';
33
SELECTNULL::ltree;
44

55

‎contrib/ltree_plpython/ltree_plpythonu--1.0.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- make sure the prerequisite libraries are loaded
2-
DO'1' LANGUAGE plpythonu;
2+
LOAD'plpython2';-- change to plpython3 if that ever becomes the default
33
SELECTNULL::ltree;
44

55

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp