Re: pg_upgrade Python version issue on openSUSE - Mailing list pgsql-general

From Paul Förster
Subject Re: pg_upgrade Python version issue on openSUSE
Date
Msg-id 9D64B513-77D4-41D9-87E5-0727FAF96C84@gmail.com
Whole thread Raw
In response to Re: pg_upgrade Python version issue on openSUSE  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pg_upgrade Python version issue on openSUSE  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: pg_upgrade Python version issue on openSUSE  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
Hi Tom,

> On 26. Sep, 2020, at 16:07, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> =?utf-8?Q?Paul_F=C3=B6rster?= <paul.foerster@gmail.com> writes:
>> seems, I found some kind of solution:
>
>> - before running "pg_upgrade --check -k":
>>  drop extension plpythonu;
>> - run pg_upgrade
>> - after the upgrade:
>>  create extension plpython3u;
>
>> Is this the correct way?
>
> If you had plpythonu installed before, that's a plausible thing
> to do.  (There was discussion some time ago about making the
> python-2-to-3 transition less painful for users, but we failed
> to come to any consensus about how; so manual fixes like this
> are going to be needed for a lot of people.)
>
> However, I don't understand how "drop extension plpythonu"
> worked for you, given your previous query showing that
> that extension wasn't installed.

just checked with another 12.4. It's the same:

postgres=# select * from pg_available_extension_versions where installed;
  name   | version | installed | superuser | relocatable |   schema   | requires |                           comment
                        

---------+---------+-----------+-----------+-------------+------------+----------+--------------------------------------------------------------
 plperlu | 1.0     | t         | t         | f           | pg_catalog |          | PL/PerlU untrusted procedural
language
 dblink  | 1.2     | t         | t         | t           |            |          | connect to other PostgreSQL
databasesfrom within a database 
 plpgsql | 1.0     | t         | f         | f           | pg_catalog |          | PL/pgSQL procedural language
 plperl  | 1.0     | t         | f         | f           | pg_catalog |          | PL/Perl procedural language
(4 rows)

postgres=# drop extension plpythonu ;
DROP EXTENSION
postgres=# create extension plpython3u ;
CREATE EXTENSION

The "plpython" and "plpython3u" for the drop and create extension statements came by entering "plpy" and then pressing
tab.So PostgreSQL knew about them. Still, as you can see, I could drop pypythonu again though it did not appear in the
query.After the create extension, it appears as it should: 

postgres=# select * from pg_available_extension_versions where installed;
    name    | version | installed | superuser | relocatable |   schema   | requires |                           comment
                           

------------+---------+-----------+-----------+-------------+------------+----------+--------------------------------------------------------------
 plperlu    | 1.0     | t         | t         | f           | pg_catalog |          | PL/PerlU untrusted procedural
language
 dblink     | 1.2     | t         | t         | t           |            |          | connect to other PostgreSQL
databasesfrom within a database 
 plpython3u | 1.0     | t         | t         | f           | pg_catalog |          | PL/Python3U untrusted procedural
language
 plpgsql    | 1.0     | t         | f         | f           | pg_catalog |          | PL/pgSQL procedural language
 plperl     | 1.0     | t         | f         | f           | pg_catalog |          | PL/Perl procedural language
(5 rows)

Is this a bug in 12.4 not showing the extension?

Cheers,
Paul


pgsql-general by date:

Previous
From: Julien Rouhaud
Date:
Subject: Re: PG 13 trusted extensions and pg_available_extensions
Next
From: Tom Lane
Date:
Subject: Re: pg_upgrade Python version issue on openSUSE