From: Marcin Giedz <marcin.giedz@arise.pl>
To: Magnus Hagander <magnus@hagander.net>
Cc: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Devrim Gündüz <devrim@gunduz.org>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: pg_upgrade from 12 to 13 failes with plpython2
Date: Wed, 18 Nov 2020 11:05:47 +0100 (CET)
Message-ID: <241497908.1487873.1605693947374.JavaMail.zimbra@arise.pl> (raw)
In-Reply-To: <CABUevEzHz4cEtxDQLkdVVzAzfQtWXs=hOiSxD=SCDZwoXeKjng@mail.gmail.com>
References: <1965058112.1483134.1605643217808.JavaMail.zimbra@arise.pl>
<dfd87b12e00fae5829feb655bec10aac94acd37c.camel@gunduz.org>
<7820164d-5086-b3e2-e200-3f02f07b6280@aklaver.com>
<938921.1605648230@sss.pgh.pa.us>
<f722e1f93c75c17826460951e596baeb0d4a4e0c.camel@gunduz.org>
<f8fe260a-4518-5901-15b7-43f56b373d71@aklaver.com>
<410666958.1483934.1605683452910.JavaMail.zimbra@arise.pl>
<CABUevEzHz4cEtxDQLkdVVzAzfQtWXs=hOiSxD=SCDZwoXeKjng@mail.gmail.com>
right, I had one function relaying on plpython2u so I changed it... but the again pg_upgrade claims error with python:
cat loadable_libraries.txt
could not load library "$libdir/plpython2": ERROR: could not access file "$libdir/plpython2": No such file or directory
In database: argosrm
In database: template1
marcin@carbon2:~$ psql -U pgsql -h 192.168.89.64 postgres
psql (12.4 (Ubuntu 12.4-1), server 12.5)
Type "help" for help.
postgres=# select * from pg_language ;
oid | lanname | lanowner | lanispl | lanpltrusted | lanplcallfoid | laninline | lanvalidator | lanacl
-------+----------+----------+---------+--------------+---------------+-----------+--------------+--------
12 | internal | 10 | f | f | 0 | 0 | 2246 |
13 | c | 10 | f | f | 0 | 0 | 2247 |
14 | sql | 10 | f | t | 0 | 0 | 2248 |
14177 | plpgsql | 10 | t | t | 14174 | 14175 | 14176 |
(4 rows)
postgres=# \c argosrm
psql (12.4 (Ubuntu 12.4-1), server 12.5)
You are now connected to database "argosrm" as user "pgsql".
argosrm=# select * from pg_language ;
oid | lanname | lanowner | lanispl | lanpltrusted | lanplcallfoid | laninline | lanvalidator | lanacl
---------+------------+----------+---------+--------------+---------------+-----------+--------------+--------
12 | internal | 10 | f | f | 0 | 0 | 2246 |
13 | c | 10 | f | f | 0 | 0 | 2247 |
14 | sql | 10 | f | t | 0 | 0 | 2248 |
14177 | plpgsql | 10 | t | t | 14174 | 14175 | 14176 |
1824389 | plpython3u | 10 | t | f | 1824386 | 1824387 | 1824388 |
(5 rows)
argosrm=# \c template1
psql (12.4 (Ubuntu 12.4-1), server 12.5)
You are now connected to database "template1" as user "pgsql".
template1=# select * from pg_language ;
oid | lanname | lanowner | lanispl | lanpltrusted | lanplcallfoid | laninline | lanvalidator | lanacl
-------+----------+----------+---------+--------------+---------------+-----------+--------------+--------
12 | internal | 10 | f | f | 0 | 0 | 2246 |
13 | c | 10 | f | f | 0 | 0 | 2247 |
14 | sql | 10 | f | t | 0 | 0 | 2248 |
14177 | plpgsql | 10 | t | t | 14174 | 14175 | 14176 |
(4 rows)
template1=# drop language plpython2u;
ERROR: language "plpython2u" does not exist
template1=# drop language plpython;
ERROR: language "plpython" does not exist
template1=# drop language plpythonu;
ERROR: language "plpythonu" does not exist
template1=# \c postgres
psql (12.4 (Ubuntu 12.4-1), server 12.5)
You are now connected to database "postgres" as user "pgsql".
postgres=# drop language plpythonu;
ERROR: language "plpythonu" does not exist
postgres=# drop language plpython;
ERROR: language "plpython" does not exist
postgres=# drop language plpython2u;
ERROR: language "plpython2u" does not exist
postgres=# \c argosrm
psql (12.4 (Ubuntu 12.4-1), server 12.5)
You are now connected to database "argosrm" as user "pgsql".
argosrm=# drop language plpython2u;
ERROR: language "plpython2u" does not exist
argosrm=# drop language plpython;
ERROR: language "plpython" does not exist
argosrm=# drop language plpythonu;
ERROR: language "plpythonu" does not exist
argosrm=#
argosrm=# select * from pg_pltemplate ;
tmplname | tmpltrusted | tmpldbacreate | tmplhandler | tmplinline | tmplvalidator | tmpllibrary | tmplacl
------------+-------------+---------------+------------------------+--------------------------+---------------------+-------------------+---------
plpgsql | t | t | plpgsql_call_handler | plpgsql_inline_handler | plpgsql_validator | $libdir/plpgsql |
pltcl | t | t | pltcl_call_handler | | | $libdir/pltcl |
pltclu | f | f | pltclu_call_handler | | | $libdir/pltcl |
plperl | t | t | plperl_call_handler | plperl_inline_handler | plperl_validator | $libdir/plperl |
plperlu | f | f | plperlu_call_handler | plperlu_inline_handler | plperlu_validator | $libdir/plperl |
plpython3u | f | f | plpython3_call_handler | plpython3_inline_handler | plpython3_validator | $libdir/plpython3 |
(6 rows)
argosrm=# \c postgres
psql (12.4 (Ubuntu 12.4-1), server 12.5)
You are now connected to database "postgres" as user "pgsql".
postgres=# select * from pg_pltemplate ;
tmplname | tmpltrusted | tmpldbacreate | tmplhandler | tmplinline | tmplvalidator | tmpllibrary | tmplacl
------------+-------------+---------------+------------------------+--------------------------+---------------------+-------------------+---------
plpgsql | t | t | plpgsql_call_handler | plpgsql_inline_handler | plpgsql_validator | $libdir/plpgsql |
pltcl | t | t | pltcl_call_handler | | | $libdir/pltcl |
pltclu | f | f | pltclu_call_handler | | | $libdir/pltcl |
plperl | t | t | plperl_call_handler | plperl_inline_handler | plperl_validator | $libdir/plperl |
plperlu | f | f | plperlu_call_handler | plperlu_inline_handler | plperlu_validator | $libdir/plperl |
plpython3u | f | f | plpython3_call_handler | plpython3_inline_handler | plpython3_validator | $libdir/plpython3 |
(6 rows)
postgres=# \c template1
psql (12.4 (Ubuntu 12.4-1), server 12.5)
You are now connected to database "template1" as user "pgsql".
template1=# select * from pg_pltemplate ;
tmplname | tmpltrusted | tmpldbacreate | tmplhandler | tmplinline | tmplvalidator | tmpllibrary | tmplacl
------------+-------------+---------------+------------------------+--------------------------+---------------------+-------------------+---------
plpgsql | t | t | plpgsql_call_handler | plpgsql_inline_handler | plpgsql_validator | $libdir/plpgsql |
pltcl | t | t | pltcl_call_handler | | | $libdir/pltcl |
pltclu | f | f | pltclu_call_handler | | | $libdir/pltcl |
plperl | t | t | plperl_call_handler | plperl_inline_handler | plperl_validator | $libdir/plperl |
plperlu | f | f | plperlu_call_handler | plperlu_inline_handler | plperlu_validator | $libdir/plperl |
plpython3u | f | f | plpython3_call_handler | plpython3_inline_handler | plpython3_validator | $libdir/plpython3 |
(6 rows)
template1=#
Od: "Magnus Hagander" <magnus@hagander.net>
Do: "Marcin Giedz" <marcin.giedz@arise.pl>
DW: "Adrian Klaver" <adrian.klaver@aklaver.com>, "Tom Lane" <tgl@sss.pgh.pa.us>, "Devrim Gündüz" <devrim@gunduz.org>, "pgsql-general" <pgsql-general@lists.postgresql.org>
Wysłane: środa, 18 listopad 2020 10:36:10
Temat: Re: pg_upgrade from 12 to 13 failes with plpython2
On Wed, Nov 18, 2020 at 8:11 AM Marcin Giedz <marcin.giedz@arise.pl> wrote:
>
> but my question still remains the same - what causes pg_upgrade failure - are functions the reason? what I did was to delete these 2 rows from pg_pltemplate as I thought this may help:
>
> postgres=# delete from pg_pltemplate where tmplname = 'plpython2u';
> DELETE 1
> postgres=# delete from pg_pltemplate where tmplname = 'plpythonu';
> DELETE 1
>
>
> but pg_upgrade still complains about plpython2:
>
> cat loadable_libraries.txt
> could not load library "$libdir/plpython2": ERROR: could not access file "$libdir/plpython2": No such file or directory
> In database: alaxx
> In database: template1
It's not the template that's interesting, it's the language itself you
need to drop. Log into each database and try to do that, and you will
get something like this if you still have functions using it:
postgres=# DROP LANGUAGE plpython2u;
ERROR: cannot drop language plpython2u because other objects depend on it
DETAIL: function testfunc() depends on language plpython2u
HINT: Use DROP ... CASCADE to drop the dependent objects too.
If you have no functions using it, it will just go away, and once you
have dropped it in both databases you should be good to go.
And of course, if there are functions depending on it, you should
rebuild those on plpython3u before you drop plpython2u (or drop the
functions if they're not in use).
--
Magnus Hagander
Me: https://www.hagander.net/
Work: https://www.redpill-linpro.com/
--
Pozdrawiam
Marcin Giedz
Wiceprezes Zarządu
ARISE Sp. z o.o.
mob. +48 606 673 977
mail: marcin.giedz@arise.pl
Al. Solidarności 117
00-140 Warszawa
tel. +48 (22) 440 56 20
fax +48 (22) 440 56 22
http://www.arise.pl
Grupa ARISE: ARISE Sp. z o.o. (podmiot dominujący), ARISE Services S.A., Al. Solidarności 117, 00-140 Warszawa, Sąd Rejonowy dla m. st. Warszawy w Warszawie XII Wydział Gospodarczy Krajowego Rejestru Sądowego, KRS 0000316860, REGON 141595449, NIP 5272590610, kapitał zakładowy wpłacony 250,000.00 zł.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: marcin.giedz@arise.pl, magnus@hagander.net, adrian.klaver@aklaver.com, tgl@sss.pgh.pa.us, devrim@gunduz.org
Subject: Re: pg_upgrade from 12 to 13 failes with plpython2
In-Reply-To: <241497908.1487873.1605693947374.JavaMail.zimbra@arise.pl>
References: <1965058112.1483134.1605643217808.JavaMail.zimbra@arise.pl> <dfd87b12e00fae5829feb655bec10aac94acd37c.camel@gunduz.org> <7820164d-5086-b3e2-e200-3f02f07b6280@aklaver.com> <938921.1605648230@sss.pgh.pa.us> <f722e1f93c75c17826460951e596baeb0d4a4e0c.camel@gunduz.org> <f8fe260a-4518-5901-15b7-43f56b373d71@aklaver.com> <410666958.1483934.1605683452910.JavaMail.zimbra@arise.pl> <CABUevEzHz4cEtxDQLkdVVzAzfQtWXs=hOiSxD=SCDZwoXeKjng@mail.gmail.com> <241497908.1487873.1605693947374.JavaMail.zimbra@arise.pl>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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