【问题标题】:Upgrade postgresql 9.6 -> postgresql 13 blocked by missing plpython2 extension, but I can't seem to remove the extension升级 postgresql 9.6 -> postgresql 13 因缺少 plpython2 扩展而被阻止,但我似乎无法删除扩展
【发布时间】:2020-11-03 16:04:59
【问题描述】:

我正在尝试使用 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 仍然给我上述关于缺少扩展的错误。

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

【问题讨论】:

  • 新错误是否仍然显示“在数据库中:infohub”?可能需要将其放入多个数据库中。

标签: postgresql plpython


【解决方案1】:

在所有数据库中运行以下语句:

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

然后您就知道哪些功能有问题并可以将其删除。

【讨论】:

  • 感谢您的超级有用的回复!
猜你喜欢
  • 2021-01-15
  • 1970-01-01
  • 1970-01-01
  • 2018-03-05
  • 2017-09-26
  • 1970-01-01
  • 1970-01-01
  • 2011-09-04
  • 2020-06-09
相关资源
最近更新 更多