I'm getting the following error:

postgres@:~/>cat loadable_libraries.txt could not load library "$libdir/plpython2": ERROR: could not access file "$libdir/plpython2": No such file or directory In database: db_name

When trying to run pg_upgrade from PostgreSQL-11 to PostgreSQL-13.

/usr/pgsql-13/bin/pg_upgrade -b /usr/pgsql-11/bin -B /usr/pgsql-13/bin -c -d /localpart0/db/postgres/11/db_name/data -D/localpart0/db/postgres/13/db_name/data -j 20 -r -v --clone

I don't have any plpython* extensions and already tried changing the pg_pltemplate entries for plpythonu and plpython2u to plpython3 and run the pg_upgrade but it fails either way.

Installed Packages:

postgresql11-plpython.x86_64 11.7-1PGDG.rhel7 @postgres11.prd postgresql13-plpython3.x86_64 13.1-1PGDG.rhel7 @postgres13.prd

Any guidance would be greatly appreciated.

  • Which Linux distribution are you using?
    – user1822
    Dec 21, 2020 at 14:35
  • "I don't have any plpython* extensions" What does that mean? You aren't using them in either system? The extensions aren't created in either system? The control files don't even exist in either system?
    – jjanes
    Dec 21, 2020 at 15:03
  • I'm using Linux 3.10.0-1127.13.1.el7.x86_64 #1 SMP Tue Jun 23 15:46:38 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux Dec 28, 2020 at 16:08
  • The only update I have is that by removing any and all references of plpython2 from the pg11 cluster, I was able to run the upgrade. Not sure if this means that I'm going to have to upgrade any and all plpython2 functions to plpython3 prior to upgrade or not...I thought pg13 upgrade was going going to be compatible with plpython2. Dec 28, 2020 at 16:12
  • Relevant announcement from Devrim Gündüz, who builds the RHEL PostgreSQL RPMs: people.planetpostgresql.org/devrim/index.php?/archives/… … short answer, the packager dropped plpython2 support.
    – dwhitemv
    Dec 6, 2022 at 23:15

1 Answer 1


If someone has a better answer or suggestion please let me know. Otherwise, I believe I found the answer in the pgsql-general mailing list;



On Tue, 2020-11-17 at 21:00 +0100, Marcin Giedz wrote:

Hi all, trying to performe upgrade from 12 to 13 installed from Centos8 repo gives such error:

cat loadable_libraries.txt could not load library "$libdir/plpython2": ERROR: could not access file "$libdir/plpython2": No such file or directory

I dropped PL/Python support along with PostgreSQL 13 RPMs.


Devrim Gündüz Open Source Solution Architect, Red Hat Certified Engineer Twitter: @DevrimGunduz , @DevrimGunduzTR

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.