简体   繁体   中英

upgrading postgresql cluster from 9.5 to 11 nominatim.so incompatible

PostgreSQL 9.5
Database nominatim
if I try to upgrade postgresql to 11 with:

sudo pg_upgradecluster -m upgrade -k 9.5 main

result:

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

could not load library "/mnt/data/openstreetmap/nominatim/Nominatim-2.5.1/module/nominatim.so": ERROR: biblioteca «/mnt/data/openstreetmap/nominatim/Nominatim-2.5.1/mo dule/nominatim.so» incompatible: versión no coincide DETALLE: Server is version 11, library is version 9.5.

What steps should I follow to avoid having to delete the database and recreate it?

postgresql 9.5 to 11
nomintaim with postgis 2.2 to 2.5

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

...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM