Re: BUG #13861: Database dump does not load when both plpython2u and plpython3u functions are used

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: roman(dot)vanicek(at)gmail(dot)com
Cc: PostgreSQL mailing lists <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #13861: Database dump does not load when both plpython2u and plpython3u functions are used
Date: 2016-01-13 01:36:58
Message-ID: CAB7nPqTncXQn7SkGTPvRNwTHqKVpmfEkeg0t0wMG1n7mr8rbSQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, Jan 13, 2016 at 4:42 AM, <roman(dot)vanicek(at)gmail(dot)com> wrote:
> Use case:
> I have a database that uses both plpython2u and plpython3u extensions and
> some functions using them.
>
> When trying do restore the database on 9.5 server after dump, it produces
> fatal error.
>
> On postgresql-9.4:
> pg_dumpall > all.dump
>
> On postgresql-9.5:
> psql < all.dump
>
> Result:
> FATAL: Python major version mismatch in session
> DETAIL: This session has previously used Python major version 2, and it is
> now attempting to use Python major version 3.
> HINT: Start a new session to use a different Python major version.
> server closed the connection unexpectedly
> This probably means the server terminated abnormally
> before or while processing the request.
> connection to server was lost

A problem has been fixed in this area a couple of days back:

commit: db8fa56d6ad15621ad4f74667bfd59533408ce16
author: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
date: Mon, 11 Jan 2016 19:55:39 -0500
Avoid dump/reload problems when using both plpython2 and plpython3.

Commit 803716013dc1350f installed a safeguard against loading plpython2
and plpython3 at the same time, but asserted that both could still be
used in the same database, just not in the same session. However, that's
not actually all that practical because dumping and reloading will fail
(since both libraries necessarily get loaded into the restoring session).
pg_upgrade is even worse, because it checks for missing libraries by
loading every .so library mentioned in the entire installation into one
session, so that you can have only one across the whole cluster.

You may want to just wait for 9.5.1.
--
Michael

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Shulgin, Oleksandr 2016-01-13 08:11:53 Re: permissions.
Previous Message Mark Kirkwood 2016-01-13 01:31:28 Re: BUG #13852: SQL Select Slow Issues