我正在使用默认文档在Arch上从Postgres 15升级到16。当我到达pg_upgrade部分时:
pg_upgrade -b /opt/pgsql-15/bin -B /usr/bin -d /var/lib/postgres/olddata -D /var/lib/postgres/data
字符串
然后我得到一个“失败”退出。当我检查pg_upgrade_output.d日志文件时,我发现一个与PostGIS路径相关的错误:
command: "/usr/bin/pg_dump" --host /var/lib/postgres --port 50432 --username postgres --schema-only --quote-all-identifiers --binary-upgrade --format=custom --file="/var/lib/postgres/data/pg_upgrade_output.d/20231207T105131.842/dump/pg_upgrade_dump_16385.custom" 'dbname=linuxbox_db' >> "/var/lib/postgres/data/pg_upgrade_output.d/20231207T105131.842/log/pg_upgrade_dump_16385.log" 2>&1
pg_dump: error: query failed: ERROR: could not access file "$libdir/postgis-3": No such file or directory
型
是我系统上的问题还是pg_upgrade代码中的错误?
1条答案
按热度按时间anauzrmj1#
这个错误是因为我需要在安装v16之后和运行pg_upgrade之前重建postgis库。
如果其他人最终在Arch上升级遇到问题,这里是我遵循的步骤的总结:
sudo systemctl stop postgresql.service
sudo mv /var/lib/postgres/data /var/lib/postgres/olddata
sudo mkdir /var/lib/postgres/data /var/lib/postgres/tmp
sudo chown postgres:postgres /var/lib/postgres/data /var/lib/postgres/tmp
sudo -i -u postgres
[postgres]$ cd /var/lib/postgres/tmp
[postgres]$ initdb -D /var/lib/postgres/data --locale=C.UTF-8 --encoding= UTF 8
sudo systemctl start postgresql.service
pgxn install h3
sudo systemctl stop postgresql.service
[postgres]$ pg_upgrade -B /opt/pgsql-PG_VERSION/bin -B /usr/bin -d /var/lib/postgres/olddata -D /var/lib/postgres/data