我升级了从PostgreSQL 9.3到9.4,现在我想迁移我的数据。
所以这是我尝试做的。首先我这样运行旧的PostgreSQL
并且它告诉我:
好的,现在什么是
所以这是我尝试做的。首先我这样运行旧的PostgreSQL
/opt/pgsql-9.3/bin/pg_ctl -D /var/lib/postgres/data/ start
接着,我尝试将旧数据库导出到文件中:
/opt/pgsql-9.3/bin/pg_dumpall >> old_backup.sql
并且它告诉我:
pg_dump: [archiver (db)] query failed: ERROR: could not access file "$libdir/postgis-2.1": No such file or directory
好的,我尝试找到postgis-2.1文件并将它们复制到libdir
中。
find / -name "*postgis-2.1*"
/usr/lib/postgresql/rtpostgis-2.1.so
/usr/lib/postgresql/postgis-2.1.so
/usr/lib/postgresql/postgis-2.1 <-----
好的,现在什么是
libdir
呢?/opt/pgsql-9.3/bin/pg_config --pkglibdir
/opt/pgsql-9.3/lib
所以我在 /opt/pgsql-9.3/lib
中创建了一个符号链接指向 /usr/lib/postgresql/postgis-2.1
目录,操作如下:
pwd
/opt/pgsql-9.3/lib
ls -l postgis-2.1
postgis-2.1 -> /usr/share/postgresql/contrib/postgis-2.1
但我仍然收到错误提示:查询失败:错误:无法访问文件“$libdir/postgis-2.1”:没有那个文件或目录
我已经没有更多的想法了。也许有人可以帮忙吗?
我正在使用Arch Linux。
P.S:
Postgis 已经安装好了:
pacman -S postgis
warning: postgis-2.1.5-1 is up to date -- reinstalling
以下是二进制文件:
find / -name "*postgis-2.1*"
/usr/lib/postgresql/rtpostgis-2.1.so <---- binary
/usr/lib/postgresql/postgis-2.1.so <----- binary
/opt/pgsql-9.3/lib/postgis-2.1 <----- that's the symlink from earlier
/usr/share/postgresql/contrib/postgis-2.1
pg_upgrade
进行的吗?顺便问一下:在你用符号链接的共享库进行折腾后,是否运行了 ldconfig? - wildplasserldconfig
或者ldconfig -v
以获取更多详细信息。你的.so文件应该会在输出中显示出来(如果没有显示,则说明你的配置文件存在问题)。我不知道pacman。 - wildplasser