Jen*_*nov 5 linux postgresql postgis archlinux
我从postgresql 9.3升级到9.4,现在我想迁移我的数据.
所以这就是我试图做的.首先我像这样运行旧的postgresql
/opt/pgsql-9.3/bin/pg_ctl -D /var/lib/postgres/data/ start
Run Code Online (Sandbox Code Playgroud)
然后,我尝试将旧数据库转储到文件中:
/opt/pgsql-9.3/bin/pg_dumpall >> old_backup.sql
Run Code Online (Sandbox Code Playgroud)
它告诉我:
pg_dump: [archiver (db)] query failed: ERROR: could not access file "$libdir/postgis-2.1": No such file or directory
Run Code Online (Sandbox Code Playgroud)
好吧,我试图找到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 <-----
Run Code Online (Sandbox Code Playgroud)
好的,现在是什么libdir?
/opt/pgsql-9.3/bin/pg_config --pkglibdir
/opt/pgsql-9.3/lib
Run Code Online (Sandbox Code Playgroud)
所以我在做一个符号链接/opt/pgsql-9.3/lib到here /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
Run Code Online (Sandbox Code Playgroud)
但我仍然得到错误:查询失败:错误:无法访问文件"$ libdir/postgis-2.1":没有这样的文件或目录
我有点想法.也许有人可以帮助我?
我是usnig arch linux
PS
Postgis已安装:
pacman -S postgis
warning: postgis-2.1.5-1 is up to date -- reinstalling
Run Code Online (Sandbox Code Playgroud)
以下是二进制文件:
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
Run Code Online (Sandbox Code Playgroud)
我有类似的问题,但解决方法有点不同:
dbname=#\dx
Name | Version | Schema | Description
---------+---------+------------+---------------------------------------------------------------------
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
postgis | 2.1.5 | postgis | PostGIS geometry, geography, and raster spatial types and functions
dbname=#ALTER EXTENSION postgis UPDATE TO '2.2.0';
dbname=#\dx
Name | Version | Schema | Description
---------+---------+------------+---------------------------------------------------------------------
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
postgis | 2.2.0 | postgis | PostGIS geometry, geography, and raster spatial types and functions
Run Code Online (Sandbox Code Playgroud)
符号链接指向"共享"文件,用于CREATE EXTENSION和家庭.你需要的是将.so文件指向返回的目录pg_config --pkglibdir:
$ rm /opt/pgsql-9.3/lib/postgis-2.1 # it is a wrong link, so undo it
$ ln -s /usr/lib/postgresql/postgis-2.1.so /opt/pgsql-9.3/lib/
Run Code Online (Sandbox Code Playgroud)
现在PostGIS .so文件将进入"$libdir",您将能够执行pg_dumpall.
当然保持这种方式不会让我理智,但是作为你的升级,我假设这只是一个中间状态,你将完全删除PostgreSQL 9.3.您还必须验证PostGIS是否与9.3库链接,否则您可能会遇到一些问题.
| 归档时间: |
|
| 查看次数: |
4355 次 |
| 最近记录: |