将postgresql集群从9.5升级到nominatim.so不兼容

时间:2019-02-14 09:51:49

标签: postgresql postgis nominatim

PostgreSQL 9.5
数据库标称值
如果我尝试通过以下方式将postgresql升级到11:

sudo pg_upgradecluster -m upgrade -k 9.5 main

结果:

more /var/log/postgresql/pg_upgradecluster-9.5-11-main.Dzbj/loadable_libraries.txt

无法加载库“ /mnt/data/openstreetmap/nominatim/Nominatim-2.5.1/module/nominatim.so”:错误:书刊«/mnt/data/openstreetmap/nominatim/Nominatim-2.5。 1 /月 dule / nominatim.so»不兼容:versión不一致 详细信息:服务器的版本为11,库的版本为9.5。

我应该采取哪些步骤以避免不得不删除数据库并重新创建数据库?

1 个答案:

答案 0 :(得分:0)

PostgreSQL 9.5至11
带有postgis 2.2到2.5的nomintaim

sudo apt-get install curl ca-certificates
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
sudo apt-get update
sudo apt-get install postgresql-11
sudo service postgresql stop
sudo pg_dropcluster --stop 11 main
sudo apt-get install postgresql-11-postgis-2.5
sudo apt-get install postgresql-server-dev-11
sudo apt-get install postgresql-doc-11
sudo apt-get install postgresql-contrib
sudo apt-get install postgresql-9.5-postgis-2.5
sudo cp /usr/lib/postgresql/11/lib/postgis-2.5.so /usr/lib/postgresql/11/lib/postgis-2.2.so
sudo cp /usr/lib/postgresql/11/lib/rtpostgis-2.5.so /usr/lib/postgresql/11/lib/rtpostgis-2.2.so
sudo service postgresql start
sudo psql gis postgres -c 'ALTER EXTENSION postgis UPDATE TO "2.5.1";'
sudo psql nominatim postgres -c 'ALTER EXTENSION postgis UPDATE TO "2.5.1";'
sudo service postgresql stop
sudo service postgresql start
sudo -u postgres psql -d nominatim
psql (11.1 (Ubuntu 11.1-3.pgdg16.04+1), servidor 9.5.14)
Digite «help» para obtener ayuda.

nominatim=# SELECT postgis_full_version();
nominatim=# \q
sudo service postgresql stop
su - nominatim
cd /..../Nominatim-3.2.0/
mv build build.old
mkdir build
cd build/
cmake ..
make
sudo pg_upgradecluster -m upgrade 9.5 main
sudo su postgres -c "/usr/lib/postgresql/11/bin/vacuumdb --all --analyze-in-stages"
sudo pg_dropcluster 9.5 main --stop

...