Re: obsoleting plpython2u and defaulting plpythonu to plpython3u

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pavel Raiskup <praiskup(at)redhat(dot)com>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, PostgreSQL Hacker <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: obsoleting plpython2u and defaulting plpythonu to plpython3u
Date: 2019-08-23 18:27:47
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Pavel Raiskup <praiskup(at)redhat(dot)com> writes:
> On Wednesday, April 25, 2018 12:17:05 AM CEST Peter Eisentraut wrote:
>> On 4/24/18 07:13, Pavel Raiskup wrote:
>>> What's the expected future migration path from plpython2 to plpython3 in
>>> such cases? I'm thinking about rewrite of the docs and creating some
>>> scripting which could simplify the migration steps. Would such patches be
>>> welcome at this point?

>> I'm not sure what you have in mind. In many cases, you can just change
>> the LANGUAGE clause. I suppose you could run 2to3 over the function
>> body? Write a PL/Python function to run 2to3?

> Something along those lines, yes. Well, I don't have a real plan. I'd
> like to discuss what's the expected way out, how to give a chance to users
> to migrate from plpython2 to plpython3 _now_ (since both are yet
> available).
> I _guess_ the users don't care much about 2 vs. 3 in plpython - so they
> usually simply live with implicit plpython version - which would OTOH mean
> that the majority will have to face the migration sooner or later.

It's still not very clear to me whether we can or should change anything
about what "plpythonu" means. However, it seems like we definitely ought
to be encouraging PL/Python users to switch their code to Python 3.

As an exercise, I wrote a little script that runs through all the Python 2
functions in a database and converts them to Python 3, insofar as "2to3"
can do that. This is by a noticeable margin the largest Python script
I've ever written, so I'm sure it sucks stylistically and perhaps
functionally too, but it will serve to get some discussion started.
Should we provide something like this to users, and if so how exactly
(installed file and/or documentation)? Would it be sane to squeeze
into v12 at this late date? I suspect that Fedora might want to have it
in their v12 distro even if we only put it into HEAD.

regards, tom lane

Attachment Content-Type Size
python3-update.sql text/x-sql 1.9 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ahsan Hadi 2019-08-23 19:15:32 Re: WIP/PoC for parallel backup
Previous Message Ibrar Ahmed 2019-08-23 17:50:09 Re: WIP/PoC for parallel backup