Re: 9.4 -> 9.5 upgrade problem when both python2 and python3 present

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Paul Jones <pbj(at)cmicdo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: 9.4 -> 9.5 upgrade problem when both python2 and python3 present
Date: 2016-01-11 15:04:16
Message-ID: 12338.1452524656@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Paul Jones <pbj(at)cmicdo(dot)com> writes:
> pg_upgrade complains about not being able to find $libdir/plpython3
> when upgrading a 9.4 cluster that has both python2 and python3 used.

No, that's not what the error message says:

> Could not load library "$libdir/plpython3"
> 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.

This is a restriction we put in place because libpython2 and libpython3
don't coexist nicely in the same address space. Unfortunately, it makes
it problematic to restore a dump that contains references to both python2
and python3 functions.

It looks like pg_upgrade tries to load all libraries from functions in
any database in the old cluster into a single session in the new cluster,
which will fail in a scenario like this even if you keep python2 and
python3 functions rigorously separated into distinct databases. I'm
not sure if we could weaken that test enough to work.

> I dropped the python2 database but still got the problem.

You must still have at least one database that contains references
to python2 (check pg_language to be sure).

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2016-01-11 15:14:33 Re: Request - repeat value of \pset title during \watch interations
Previous Message Neil Tiffin 2016-01-11 14:00:01 Re: Code of Conduct: Is it time?