[SOLVED] Problems to start postgresql with postgis after upgrade to fedora 28
FedoraThis forum is for the discussion of the Fedora Project.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Problems to start postgresql with postgis after upgrade to fedora 28
Hello everyone,
I just upgraded my development machine from fedora 27 to fedora 28 today, and can't manage to get my postgresql installation to work anymore. My machine has now postgresql 10 and postgis 2.4 installed (was postgresql 9.6 and postgis 2.3 before upgrade).
When I try to start postgresql I get the following message:
Code:
An old version of the database format was found.
Use 'postgresql-setup --upgrade' to upgrade to version '10'
executing the command I get the following output:
Code:
* Upgrading database.
ERROR: pg_upgrade tool failed
ERROR: Upgrade failed.
* See /var/lib/pgsql/upgrade_postgresql.log for details.
and the relevant error in the logs:
Code:
command: "/usr/bin/pg_dump" --host /var/lib/pgsql --port 5432 --username postgres --schema-only --quote-all-identifiers --binary-upgrade --format=custom --file="pg_upgrade_dump_16385.custom" 'dbname=dbname' >> "pg_upgrade_dump_16385.log" 2>&1
pg_dump: [archiver (db)] query failed: ERROR: could not access file "$libdir/postgis-2.3": No such file or directory
pg_dump: [archiver (db)] query was: SELECT a.attnum, a.attname, a.atttypmod, a.attstattarget, a.attstorage, t.typstorage, a.attnotnull, a.atthasdef, a.attisdropped, a.attlen, a.attalign, a.attislocal, pg_catalog.format_type(t.oid,a.atttypmod) AS atttypname, array_to_string(a.attoptions, ', ') AS attoptions, CASE WHEN a.attcollation <> t.typcollation THEN a.attcollation ELSE 0 END AS attcollation, pg_catalog.array_to_string(ARRAY(SELECT pg_catalog.quote_ident(option_name) || ' ' || pg_catalog.quote_literal(option_value) FROM pg_catalog.pg_options_to_table(attfdwoptions) ORDER BY option_name), E',
') AS attfdwoptions FROM pg_catalog.pg_attribute a LEFT JOIN pg_catalog.pg_type t ON a.atttypid = t.oid WHERE a.attrelid = '18512'::pg_catalog.oid AND a.attnum > 0::pg_catalog.int2 ORDER BY a.attnum
I can see here that the upgrade script is trying to find postgis-2.3 that is not available anymore (the version in the repository is 2.4)
Often linking newer library to older name solves issues like this.
Find where postgis-2.4.so is (e.g. /database/postgresql/pgsql-10.0/lib/postgis-2.4.so) then create a symbolic link to older name so for my example I'd do:
ln -s /database/postgresql/pgsql-10.0/lib/postgis-2.4.so /database/postgresql/pgsql-10.0/lib/postgis-2.3.so
Last edited by MensaWater; 05-11-2018 at 01:09 PM.
Often linking newer library to older name solves issues like this.
Find where postgis-2.4.so is (e.g. /database/postgresql/pgsql-10.0/lib/postgis-2.4.so) then create a symbolic link to older name so for my example I'd do:
ln -s /database/postgresql/pgsql-10.0/lib/postgis-2.4.so /database/postgresql/pgsql-10.0/lib/postgis-2.3.so
Thank you, i found postgis-2.4.so in /usr/lib64/pgsql and created a symbolic link on it as you suggested but unfortunately I still get the same error when I run the upgrade script, any other ideas?
Do "su - postgres" then "echo $libdir" to verify the path in that variable. The message you got says it can't find it so I'd have expected the message to change after you created the link. i.e. It might complain about what it found but it shouldn't say not found.
Also can you run "ls -l /usr/lib64/pgsql//usr/lib64/pgsql/postgis*" and post it here.
Finally: Was your previous Postgres/Postgis installation 64 bit? It is possible to install both 32 bit and 64 bit apps on the same server so you might just be missing the 32 bit libraries.
You can determine the libdir by running (as postgres user) "pg_config --libdir". On testing my postgres 10 installs it worked. Can you run that command?
Seing this output I have try to create the symbolic link postgis-2.3.so under /usr/lib64, and create a folder /usr/lib64/postgis-2.3/, with the symbolic link inside. In both case I get the same error as before in the logs.
unpack and copy postgis-2.3.so, rtpostgis-2.3.so into
/usr/lib64/pgsql/postgresql-9.6/lib/
then cp/ln /usr/lib64/pgsql/postgis-2.4.so into /usr/lib64/pgsql/postgis-2.3.so
and cp/ln /usr/lib64/pgsql/rtpostgis-2.4.so into /usr/lib64/pgsql/rtpostgis-2.3.so
unpack and copy postgis-2.3.so, rtpostgis-2.3.so into
/usr/lib64/pgsql/postgresql-9.6/lib/
then cp/ln /usr/lib64/pgsql/postgis-2.4.so into /usr/lib64/pgsql/postgis-2.3.so
and cp/ln /usr/lib64/pgsql/rtpostgis-2.4.so into /usr/lib64/pgsql/rtpostgis-2.3.so
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.