[postgis-devel] Upgrade PostGIS from 2.5.4 to 3.1.2

Nikhil Shetty nikhil.dba04 at gmail.com
Wed Feb 2 02:39:28 PST 2022


Hi,

We didn't get any error when we ran the commands

pg13upgrade_dev=# 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;
ALTER EXTENSION
pg13upgrade_dev=# SELECT postgis_extensions_upgrade();
NOTICE: Extension postgis_sfcgal is not available or not packagable for
some reason
NOTICE: Packaging extension postgis_raster
NOTICE: Extension postgis_topology is not available or not packagable for
some reason
NOTICE: Extension postgis_tiger_geocoder is not available or not packagable
for some reason
postgis_extensions_upgrade
-------------------------------------------------------------------
Upgrade completed, run SELECT postgis_full_version(); for details
(1 row)

pg13upgrade_dev=# SELECT postgis_full_version();
postgis_full_version
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
POSTGIS="3.1.2 cbe925d" [EXTENSION] PGSQL="130" GEOS="3.9.1-CAPI-1.14.2"
PROJ="7.2.1" GDAL="GDAL 3.2.3, released 2021/04/27" LIBXML="2.9.1" LIBJSON=
"0.11" RASTER
(1 row)


After above step, we removed the symlink as shown below, so now we have
Pg13 and Postgis on 3.1.2.

lrwxrwxrwx.  1 root root      12 Feb  2 09:36 postgis-2.5.so -> postgis-3.so

lrwxrwxrwx.  1 root root      19 Feb  2 09:37 rtpostgis-2.5.so ->
postgis_raster-3.so


/usr/pgsql-13/lib # unlink postgis-2.5.so

/usr/pgsql-13/lib # unlink rtpostgis-2.5.so


For now, we are dropping the raster extension since this is test upgrade.


Thanks,
Nikhil

On Wed, Feb 2, 2022 at 2:44 AM Regina Obe <lr at pcorp.us> wrote:

> Do you get error after if you do:
>
>
>
> ALTER EXTENSION postgis UPDATE;
>
> SELECT postgis_extensions_upgrade();
>
>
>
>
>
> Or
>
>
>
> SELECT postgis_extensions_upgrade();
>
> SELECT postgis_extensions_upgrade();
>
>
>
>
>
> 2.5 on PostgreSQL 13 is not a place you want to stay even if you are
> running with 3.0 libraries.
>
> You really want to be on PostGIS 3.0 or higher with both the libs and the
> database updated.
>
>
>
> The reason being that 2.5 has postgis/raster in one extension and
> upgrading after will become very difficult.
>
>
>
>
>
>
>
> *From:* postgis-devel [mailto:postgis-devel-bounces at lists.osgeo.org] *On
> Behalf Of *Nikhil Shetty
> *Sent:* Saturday, January 29, 2022 12:50 AM
> *To:* PostGIS Development Discussion <postgis-devel at lists.osgeo.org>
> *Subject:* Re: [postgis-devel] Upgrade PostGIS from 2.5.4 to 3.1.2
>
>
>
> Hi Team,
>
>
>
> We have found another method that will help to upgrade both postgresql
> from 11 to 13 and postgis from 2.5.4 to 3.1.2.
>
>
>
> Error:
>
> could not load library "$libdir/postgis-2.5": ERROR:  could not access
> file "$libdir/postgis-2.5": No such file or directory
>
> Resolution: Create a symlink
>
> cd /usr/pgsql-13/lib
> 1) ln -s postgis-3.so <http://rtpostgis-2.4.so/> postgis-2.5.so
> <http://rtpostgis-2.3.so/>
>
> Once symlink is created proceed with pg_upgrade and it is successful. I
> wanted to confirm whether this is the right way to go?
>
> Note: We are not changing the symlink after pg_upgrade.
>
>
>
> Thanks,
>
> Nikhil
>
>
>
>
>
>
>
>
>
> On Fri, Jan 28, 2022 at 5:44 PM Sandro Santilli <strk at kbt.io> wrote:
>
> On Fri, Jan 28, 2022 at 12:40:31AM -0500, Regina Obe wrote:
>
> > Sandro,
> >
> > Can you remind me, I think you figured out a way around the raster
> > unpackaged issue so it works in PG 13 too so it should be possible for
> > someone to go straight from say PG 9.x 2.4 to PG 13 3.x
>
> I'm not sure what you're referring to.
> The `CREATE FROM UNPACKAGED` syntax was removed from
> postgis_extensions_upgrade()
> in commit 520af0e8d1bb6e9544d974713bb87e428ff4230b
> which seems to be both in 3.1 and 3.2 branches,
> not sure it landed in 3.0 (there's no notice of it in the NEWS file)
>
> --strk;
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-devel
>
> _______________________________________________
> 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-devel/attachments/20220202/ba919417/attachment-0001.html>


More information about the postgis-devel mailing list