[Tile-serving] [osm2pgsql-dev/osm2pgsql] Refuse to import if PostGIS's core procedures aren't updated. (Discussion #2140)

ImreSamu notifications at github.com
Thu Feb 15 21:45:11 UTC 2024


 > This situation can be easily detected by parsing the string returned by SELECT PostGIS_Full_Version();


I do not recommend parsing the result of 'SELECT PostGIS_Full_Version();' as the text can change at any time, or there could be a localized (non-English) version installed, which would then not work.

If the warning is still important, I would rather suggest a comparison based on the PostgreSQL meta tables, although this may yield a different result than the PostGIS_Full_Version();


```sql

SELECT
  ae.name,
  installed_version,
  default_version,
  case when installed_version <> default_version 
    THEN 'need_to_upgrade'
    ELSE 'up_to_date'
  END AS upgrade_status
FROM pg_extension e
JOIN pg_available_extensions ae on extname = ae.name
WHERE extname='postgis'
;

  name   | installed_version | default_version | upgrade_status  
---------+-------------------+-----------------+-----------------
 postgis | 3.1.7             | 3.2.5           | need_to_upgrade
(1 row)

```

vs.

```sql
SELECT PostGIS_Full_Version();

                                           postgis_full_version
---------------------------------------------------------------------------------------------------
 POSTGIS="3.1.9 3.1.9" [EXTENSION] PGSQL="120" (procs need upgrade for use with PostgreSQL "140") 
 GEOS="3.5.0-CAPI-1.9.0 4392" PROJ="Rel. 6.3.1, February 10th, 2020" LIBXML="2.9.10" 
 LIBJSON="0.17" LIBPROTOBUF="1.4.1" (core procs from "3.1.7 3.1.7" need upgrade)
 
```




-- 
Reply to this email directly or view it on GitHub:
https://github.com/osm2pgsql-dev/osm2pgsql/discussions/2140#discussioncomment-8485846
You are receiving this because you are subscribed to this thread.

Message ID: <osm2pgsql-dev/osm2pgsql/repo-discussions/2140/comments/8485846 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20240215/127bec13/attachment.htm>


More information about the Tile-serving mailing list