Re: Making plpython 2 and 3 coexist a bit better - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Making plpython 2 and 3 coexist a bit better
Date
Msg-id 9717.1452555199@sss.pgh.pa.us
Whole thread Raw
In response to Re: Making plpython 2 and 3 coexist a bit better  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I wrote:
> In further experimentation, I found out that even with this patch in
> place, the plpython transform extensions still present a dump/reload
> hazard:
> ...
> But I wonder why we couldn't make it do
> LOAD 'plpython3';

I've verified that the attached additional patch makes everything behave
nicely in this corner of the world.  AFAICS this adds no assumptions
that aren't already built into pg_pltemplate.

Last call for objections ...

            regards, tom lane

diff --git a/contrib/hstore_plperl/hstore_plperl--1.0.sql b/contrib/hstore_plperl/hstore_plperl--1.0.sql
index ea0ad76..a4fd7c2 100644
*** a/contrib/hstore_plperl/hstore_plperl--1.0.sql
--- b/contrib/hstore_plperl/hstore_plperl--1.0.sql
***************
*** 1,5 ****
  -- make sure the prerequisite libraries are loaded
! DO '' LANGUAGE plperl;
  SELECT NULL::hstore;


--- 1,5 ----
  -- make sure the prerequisite libraries are loaded
! LOAD 'plperl';
  SELECT NULL::hstore;


diff --git a/contrib/hstore_plperl/hstore_plperlu--1.0.sql b/contrib/hstore_plperl/hstore_plperlu--1.0.sql
index 46ad35c..2c2e3e3 100644
*** a/contrib/hstore_plperl/hstore_plperlu--1.0.sql
--- b/contrib/hstore_plperl/hstore_plperlu--1.0.sql
***************
*** 1,5 ****
  -- make sure the prerequisite libraries are loaded
! DO '' LANGUAGE plperlu;
  SELECT NULL::hstore;


--- 1,5 ----
  -- make sure the prerequisite libraries are loaded
! LOAD 'plperl';
  SELECT NULL::hstore;


diff --git a/contrib/hstore_plpython/hstore_plpython2u--1.0.sql b/contrib/hstore_plpython/hstore_plpython2u--1.0.sql
index c998de5..a793dc9 100644
*** a/contrib/hstore_plpython/hstore_plpython2u--1.0.sql
--- b/contrib/hstore_plpython/hstore_plpython2u--1.0.sql
***************
*** 1,5 ****
  -- make sure the prerequisite libraries are loaded
! DO '1' LANGUAGE plpython2u;
  SELECT NULL::hstore;


--- 1,5 ----
  -- make sure the prerequisite libraries are loaded
! LOAD 'plpython2';
  SELECT NULL::hstore;


diff --git a/contrib/hstore_plpython/hstore_plpython3u--1.0.sql b/contrib/hstore_plpython/hstore_plpython3u--1.0.sql
index 61d0e47..a85c85d 100644
*** a/contrib/hstore_plpython/hstore_plpython3u--1.0.sql
--- b/contrib/hstore_plpython/hstore_plpython3u--1.0.sql
***************
*** 1,5 ****
  -- make sure the prerequisite libraries are loaded
! DO '1' LANGUAGE plpython3u;
  SELECT NULL::hstore;


--- 1,5 ----
  -- make sure the prerequisite libraries are loaded
! LOAD 'plpython3';
  SELECT NULL::hstore;


diff --git a/contrib/hstore_plpython/hstore_plpythonu--1.0.sql b/contrib/hstore_plpython/hstore_plpythonu--1.0.sql
index 6acb97a..e2e4721 100644
*** a/contrib/hstore_plpython/hstore_plpythonu--1.0.sql
--- b/contrib/hstore_plpython/hstore_plpythonu--1.0.sql
***************
*** 1,5 ****
  -- make sure the prerequisite libraries are loaded
! DO '1' LANGUAGE plpythonu;
  SELECT NULL::hstore;


--- 1,5 ----
  -- make sure the prerequisite libraries are loaded
! LOAD 'plpython2';  -- change to plpython3 if that ever becomes the default
  SELECT NULL::hstore;


diff --git a/contrib/ltree_plpython/ltree_plpython2u--1.0.sql b/contrib/ltree_plpython/ltree_plpython2u--1.0.sql
index 29a12d4..f040bd3 100644
*** a/contrib/ltree_plpython/ltree_plpython2u--1.0.sql
--- b/contrib/ltree_plpython/ltree_plpython2u--1.0.sql
***************
*** 1,5 ****
  -- make sure the prerequisite libraries are loaded
! DO '1' LANGUAGE plpython2u;
  SELECT NULL::ltree;


--- 1,5 ----
  -- make sure the prerequisite libraries are loaded
! LOAD 'plpython2';
  SELECT NULL::ltree;


diff --git a/contrib/ltree_plpython/ltree_plpython3u--1.0.sql b/contrib/ltree_plpython/ltree_plpython3u--1.0.sql
index 1300a78..7afe51f 100644
*** a/contrib/ltree_plpython/ltree_plpython3u--1.0.sql
--- b/contrib/ltree_plpython/ltree_plpython3u--1.0.sql
***************
*** 1,5 ****
  -- make sure the prerequisite libraries are loaded
! DO '1' LANGUAGE plpython3u;
  SELECT NULL::ltree;


--- 1,5 ----
  -- make sure the prerequisite libraries are loaded
! LOAD 'plpython3';
  SELECT NULL::ltree;


diff --git a/contrib/ltree_plpython/ltree_plpythonu--1.0.sql b/contrib/ltree_plpython/ltree_plpythonu--1.0.sql
index 1d1af28..50f35dd 100644
*** a/contrib/ltree_plpython/ltree_plpythonu--1.0.sql
--- b/contrib/ltree_plpython/ltree_plpythonu--1.0.sql
***************
*** 1,5 ****
  -- make sure the prerequisite libraries are loaded
! DO '1' LANGUAGE plpythonu;
  SELECT NULL::ltree;


--- 1,5 ----
  -- make sure the prerequisite libraries are loaded
! LOAD 'plpython2';  -- change to plpython3 if that ever becomes the default
  SELECT NULL::ltree;



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Fuzzy substring searching with the pg_trgm extension
Next
From: Alvaro Herrera
Date:
Subject: Re: [PROPOSAL] Client Log Output Filtering