[postgis-users] [postgis-devel] Error Upgrading PostGIS 2.5.4 to 3.1.2

Nikhil Shetty nikhil.dba04 at gmail.com
Mon Apr 17 02:48:50 PDT 2023


Hi Sandro,

Old error is gone after the workaround( I had to add a hyphen in 2.5 in sed
command).

I see we are getting different error now and looks like there are a lot of
objects dependent on functions which are being dropped.

db1=# alter extension postgis update;

WARNING:  unpackaging raster

WARNING:  PostGIS Raster functionality has been unpackaged

HINT:  type `SELECT postgis_extensions_upgrade();` to finish the upgrade.
After upgrading, if you want to drop raster, run: DROP EXTENSION
postgis_raster;

ERROR:  cannot drop function st_buffer(geometry,double precision) because
other objects depend on it

DETAIL:  view xxxxx depends on function st_buffer(geometry,double precision)

HINT:  Use DROP ... CASCADE to drop the dependent objects too.


db1=# drop view xxxxx;

DROP VIEW


geo=# alter extension postgis update;

WARNING:  unpackaging raster

WARNING:  PostGIS Raster functionality has been unpackaged

HINT:  type `SELECT postgis_extensions_upgrade();` to finish the upgrade.
After upgrading, if you want to drop raster, run: DROP EXTENSION
postgis_raster;

ERROR:  cannot drop function st_intersection(geometry,geometry) because
other objects depend on it

DETAIL:  function xxxxx depends on function
st_intersection(geometry,geometry)

view xxxxx depends on function st_intersection(geometry,geometry)

HINT:  Use DROP ... CASCADE to drop the dependent objects too.


Is there a way to identify the list of objects being dropped? and which all
views/functions depend on these dropped objects?


Thanks,

Nikhil

On Mon, Apr 17, 2023 at 2:54 PM Nikhil Shetty <nikhil.dba04 at gmail.com>
wrote:

> Hi Sandro,
>
> Thank you, I will try the workaround
>
> 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 ?
>  -- We started with the upgrade at a time when 3.1.2 was the latest
> version. We will try to add the newer version in future upgrades.
>
> Thanks,
> Nikhil
>
> On Fri, Apr 14, 2023 at 5:08 PM Sandro Santilli <strk at kbt.io> wrote:
>
>> 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;
>> _______________________________________________
>> postgis-devel mailing list
>> postgis-devel at lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/postgis-devel
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20230417/df35d4c6/attachment.htm>


More information about the postgis-users mailing list