[postgis-devel] Error Upgrading PostGIS 2.5.4 to 3.1.2

Sandro Santilli strk at kbt.io
Fri Apr 14 04:40:03 PDT 2023


On Fri, Apr 14, 2023 at 01:29:02PM +0530, Nikhil Shetty wrote:

> geo=# alter extension postgis update to '3.1.2';
> ERROR:  could not access file "$libdir/postgis-2.5": No such file or directory

[...]

> We removed the old 2.5.4 packages and installed 3.1.2
> 
> ls -l /usr/pgsql-10/lib | grep postgis
> 
> -rwxr-xr-x 1 root root 1047128 Jun 29  2021 *postgis*-3.so
> -rwxr-xr-x 1 root root  850416 Jun 29  2021 *postgis*_raster-3.so
> -rwxr-xr-x 1 root root  435656 Jun 29  2021 *postgis*_sfcgal-3.so
> -rwxr-xr-x 1 root root  565008 Jun 29  2021 *postgis*_topology-3.so

A quick workaround should be something along these lines:

  for f in $('ls' /usr/pgsql-10/lib/*postgis*-3.so); do
    l=$(echo "$f" | sed 's/-3\./2.5./')
    ln -vs "$f" "$l"
  done

BUT I'm wondering: why would you want to upgrade to 3.1.2 when the
latest PostGIS version in the 3.1 branch is 3.1.8 ?

I'm asking because according to the NEWS file the bug you report
was fixed in 3.1.5:

  https://git.osgeo.org/gitea/postgis/postgis/src/tag/3.1.5/NEWS#L12

--strk;


More information about the postgis-devel mailing list