升级 postgresql 9.6 -> postgresql 13 被缺少的 plpython2 扩展阻止,但我似乎无法删除扩展

Upgrade postgresql 9.6 -> postgresql 13 blocked by missing plpython2 extension, but I can't seem to remove the extension

我正在尝试使用 Postgresql 13 附带的 pg_upgrade 将系统从 Postgresql 9.6 升级到 Postgresql 13。此升级失败并出现错误:

Your installation references loadable libraries that are missing from the new installation.  You 
can add these libraries to the new installation,
or remove the functions using them from the old installation.  A list of
problem libraries is in the file:
   loadable_libraries.txt

Failure, exiting
-bash-4.2$ cat loadable_libraries.txt
could not load library "$libdir/plpython2": ERROR:  could not access file "$libdir/plpython2": No such file or directory
In database: infohub

这个错误对我来说似乎很清楚,infohub 数据库使用了 plpython2 扩展,它没有为 postgresql 13 安装(甚至不存在)。

我的问题是我已尝试删除扩展程序,但 pg_upgrade 仍然失败并出现上述错误。

postgres=# \c infohub
psql (13.0, server 9.6.19)
You are now connected to database "infohub" as user "postgres".
infohub=# DROP EXTENSION plpythonu CASCADE ;
DROP EXTENSION

我试过使用这个语句来检查是否有任何功能

infohub=# select  DISTINCT l.lanname as function_language
from pg_proc p
left join pg_language l on p.prolang = l.oid
;


function_language

-------------------  
internal  
sql   
c   
plpgsql  
(4 rows)

据我所知,没有依赖于 plpythonu(或 plpython2)的函数,但是 pg_upgrade 仍然给我关于缺少扩展名的上述错误。

任何帮助或想法将不胜感激。

运行所有数据库中的如下语句:

SELECT oid::regprocedure
FROM pg_catalog.pg_proc
WHERE probin = '$libdir/plpython2';

然后你就知道哪些功能有问题了,可以删除它们。