Score:0

Upgrading Fedora Server to 37, Postgres' upgrade didn't work: ERROR: could not access file "$libdir/postgis-3"

ru flag

After everything else was shown to be working fine (YAY!), Postgres refused to start (don't be thrown by the name - Postgres was packaged as PostgreSQL in praise of Paul Aoki's conversion of the QUEL query language processor to use SQL WAY back in the first packaged release in 1995 - everything but the packaging/branding uses the name Postgres).

This failure to start was not unexpected, though the package COULD have anticipated this for upgrades, since all upgraded installations likely have a need to do this, and run the appropriate upgrade script for us; that script can be run thus:

postgresql-setup --upgrade --upgrade-from postgresql

Unfortunately, it failed.

I followed the trail of error bread-crumbs - a log file in the Postgres user's home directory, pointed to by an intermediate log that's spit out to stdout by said command, pointed to an issue with Postgis, which is used by the installation.

The most pertinent error message said:

ERROR:  could not access file "$libdir/postgis-3"

Unfortunately, it didn't say where $libdir is supposed do be, and equally unfortunately, I don't know where it is, either! I haven't yet found any directory containing the name postgis.

I presumed Postgis was not upgraded or perhaps not installed, but that proved incorrect with a simple check of installed packages: It's called postgis-3.2.2-1.fc37.x86_64

As the error message had complained about not finding a part of postgis-3 and yet a postgis version 3 is installed was a surprise to me.

I have no fix yet. Thoughts? This MUST be a common problem for Postgres users who also use Postgis!

Score:1
id flag

PostGIS is an extension which is installed as package. You have to install the package that suits both your postgresql major version and postgis extension version. Such as; postgis32_15 or postgis31_14

$libdir or any other predefined (mostly comes with compilation) configurations can be learned with pg_config client application. You can basically learn libdir by running the command below.

pg_config --pkglibdir

if you cannot find pg_config then its most propably where psql command is ($bindir) .

ru flag
Good information and that sounds good but unfortunately, it isn't sufficient in my case as I DID already have the PostGIS package installed - after all, it's now a part of my template1 db! However, I can see that this might well solve the problem for some people. So, if anyone comments here that this worked for them, I'll mark it as "the answer" unless one that works for ME comes along! (Note: To get going now, I ran dumpall in the old version and reloaded in the new one and that worked flawlessly. Still, I'd like a genuine solution to this as I was lucky the installation was small!)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.