我正在尝试将PostgreSQL数据库从11.2升级到12.2,它有cstore_fdw扩展名。据我所知,这是不支持的,所以我将所有cstore外部表迁移到本地表,删除了扩展名:
create schema cstore_backup;
-- executed the results of all of these:
select
format ('create table cstore_backup.%s_%s as select * from %s.%s;',
foreign_table_schema, foreign_table_name,
foreign_table_schema, foreign_table_name)
from information_schema.foreign_tables ft
where foreign_server_name = 'cstore_server';
select
format ('drop foreign table %s.%s;',
foreign_table_schema, foreign_table_name)
from information_schema.foreign_tables ft
where foreign_server_name = 'cstore_server';
DROP SERVER cstore_server;
drop extension cstore_fdw;
我删除了文件夹(迁移后我会把它们放回cstore(:
rm -fr /apps/pgdata11.2.0/cstore_fdw
rm -f /usr/local/psql11.2/share/postgresql/extension/cst*
我从postgresql.conf文件中删除了引用。
当我运行pg_upgrade:时
$BIN/pg_upgrade
--old-bindir=/usr/local/psql11.2/bin
--new-bindir=/usr/local/psql12.2/bin
--old-datadir=/apps/pgdata11.2.0
--new-datadir=/apps/pgdata12.2.0
--old-port=5432
--new-port=5432
--jobs=4 --link --username=postgres --check
我仍然在loadable_libraries.txt输出文件中得到这条消息:
无法加载库"/usr/local/psql11.2/lib/postgresql/cstore_fdw.so":错误:无法加载库"/usr/local/psql11.2/lib/postgresql/cstore_fdw.so":/usr/local/psql11.2/lib/postgresql/store_fdw.so:未定义符号:ExecClearTuple
我被难住了。cstore_fdw仍然位于我的安装中的何处?
感谢您的建议。。。事实证明,在公共模式中有一些剩余的函数引用了扩展,尽管它已经完全消失了。我发现他们都有这个:
select * from pg_proc where prosrc ilike '%cstore%'
删除每一个都解决了问题。
drop function public.cstore_clean_table_resources(oid);
drop function public.cstore_ddl_event_end_trigger();
drop function public.cstore_drop_trigger();
drop function public.cstore_fdw_handler();
drop function public.cstore_fdw_validator(text[], oid);
drop function public.cstore_table_size(relation regclass);