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

问题描述

我正在尝试使用Postgresql 13附带的pg_upgrade将系统从Postgresql 9.6升级到Postgresql13。此升级失败,并显示以下错误:

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';

然后,您知道哪些功能有故障,可以将其删除。

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...