>我开始使用Postgresql 9.4.5和Postgis 2.1.6.一切顺利.两者都是从源头安装的.
>我将Postgis升级到2.2.0(下载源代码,配置,make,make install,然后ALTER EXTENSION postgis UPGRADE TO’2.2.0′;).这似乎有效(选择postgis_full_version()显示POSTGIS =“2.2.0 r14208”GEOS =“3.5.0-CAPI-1.9.0 r4084”PROJ =“Rel.4.9.1,2015年3月4日”GDAL =“GDAL 2.0.1,发布2015/09/15“LIBXML =”2.9.3“LIBJSON =”0.11“RASTER在安装了postgis的两个数据库上),虽然旧的postgis-2.1.so留在lib目录中.
>我尝试将Postgresql从9.4.5升级到9.5beta2.我下载源码,制作,安装,安装Postgis 2.2.0,initdb,并准备好运行pg_upgrade. pg_upgrade失败:
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
loadable_libraries.txt包含:
Could not load library “$libdir/rtpostgis-2.1”
ERROR: could not access file “$libdir/rtpostgis-2.1”: No such file or directoryCould not load library “$libdir/postgis-2.1”
ERROR: could not access file “$libdir/postgis-2.1”: No such file or directory
我不确定为什么Postgresql的新版本需要旧版本的Postgis …它不应该被删除吗?我从9.4的lib目录中移动了旧的postgis-2.1.so和rtpostgis-2.1.so文件,但错误仍然存在.
我还尝试针对Postgresql 9.5beta2编译Postgis 2.1.6,但编译失败,出现以下错误:
lwgeom_accum.c:在函数’pgis_geometry_accum_transfn’中:
lwgeom_accum.c:109:46:错误:’AggState {aka struct AggState}’没有名为’aggcontext’的成员
aggcontext =((AggState *)fcinfo-> context) – > aggcontext;
我还尝试将2.1库从9.4目录复制到9.5目录,但由于Postgresql版本不匹配而失败.
可以转储和重新加载所有数据库,但这只是最后的手段,因为数据库非常庞大.如果答案是“因为9.5仍处于测试阶段”,我可以接受,尽管他们的测试版在过去似乎相当稳定.