LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 05-11-2018, 09:11 AM   #1
Bigsfoot
LQ Newbie
 
Registered: May 2018
Posts: 5

Rep: Reputation: Disabled
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)

Does anyone knows how I can solve this problem?


Regards,

L.
 
Old 05-11-2018, 01:07 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
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.
 
Old 05-12-2018, 02:30 AM   #3
Bigsfoot
LQ Newbie
 
Registered: May 2018
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by MensaWater View Post
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?
 
Old 05-14-2018, 08:42 AM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
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.
 
Old 05-15-2018, 01:10 AM   #5
Bigsfoot
LQ Newbie
 
Registered: May 2018
Posts: 5

Original Poster
Rep: Reputation: Disabled
$libdir was empty, it tried to set it to pgsql directory by doing "export libdir=/usr/lib64/pgsql" but still get the exact same error on upgrade.

Here is the output of "ls -l /usr/lib64/pgsql/postgis*":
Code:
lrwxrwxrwx. 1 root root     31 May 15 07:57 /usr/lib64/pgsql/postgis-2.3.so -> /usr/lib64/pgsql/postgis-2.4.so
-rwxr-xr-x. 1 root root 782088 Mar 27 10:46 /usr/lib64/pgsql/postgis-2.4.so
-rwxr-xr-x. 1 root root 374864 Mar 27 10:46 /usr/lib64/pgsql/postgis_topology-2.4.so
The system was a fresh install on fedora 27, I checked dnf history and all packages were installed in 64 bits.
 
Old 05-15-2018, 08:39 AM   #6
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
This post says $libdir is hard coded.

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?
 
Old 05-15-2018, 08:59 AM   #7
Bigsfoot
LQ Newbie
 
Registered: May 2018
Posts: 5

Original Poster
Rep: Reputation: Disabled
Code:
[postgres@localhost ~]$ pg_config --libdir
/usr/lib64
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.
 
Old 05-22-2018, 04:53 AM   #8
tuzko
LQ Newbie
 
Registered: May 2018
Posts: 1

Rep: Reputation: Disabled
Solution

Too much hours solving this...

Just download postgis-2.3.3-1.fc27.x86_64.rpm,

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

and it works on fedora 28, postgresql 10

Last edited by tuzko; 05-22-2018 at 04:55 AM.
 
2 members found this post helpful.
Old 05-22-2018, 06:44 AM   #9
Bigsfoot
LQ Newbie
 
Registered: May 2018
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by tuzko View Post
Too much hours solving this...

Just download postgis-2.3.3-1.fc27.x86_64.rpm,

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

and it works on fedora 28, postgresql 10
That worked perfectly, thanks a lot !
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: PostgreSQL 9.5: A quick start on Fedora 24 LXer Syndicated Linux News 0 09-13-2016 07:21 AM
PostgreSQL 8.3 and 8.4 possible [PostGIS related] fruitwerks Ubuntu 3 01-07-2011 06:28 AM
fedora 11 postgresql problems chickenlinux Linux - Networking 4 07-08-2009 08:32 PM
help-postgres postgis install and help with server admin on vps fedora phprules Linux - Server 1 01-12-2008 01:55 AM
How to auto start Postgresql 8.0.7 on Fedora 5 ttphuong82 Fedora 1 08-24-2006 10:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 01:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration