]> granicus.if.org Git - postgis/commitdiff
Report extension status of postgis from postgis_full_version
authorSandro Santilli <strk@kbt.io>
Sun, 8 Oct 2017 20:38:06 +0000 (20:38 +0000)
committerSandro Santilli <strk@kbt.io>
Sun, 8 Oct 2017 20:38:06 +0000 (20:38 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@15937 b70326c6-7e19-0410-871a-916f4a2858ee

postgis/postgis.sql.in

index ed5bb066d97dd59a455720cb407c3abbaccd2a07..a8301d5e78d7ce014c840259eded1a037bf74ccc 100644 (file)
@@ -2814,6 +2814,7 @@ DECLARE
        sfcgal_scr_ver text;
        pgsql_scr_ver text;
        pgsql_ver text;
+       core_is_extension bool;
 BEGIN
        SELECT @extschema@.postgis_lib_version() INTO libver;
        SELECT @extschema@.postgis_proj_version() INTO projver;
@@ -2882,6 +2883,16 @@ BEGIN
 
        fullver = fullver || '"';
 
+       IF EXISTS (
+               SELECT * FROM pg_catalog.pg_extension
+               WHERE extname = 'postgis')
+       THEN
+                       fullver = fullver || ' [EXTENSION]';
+                       core_is_extension := true;
+       ELSE
+                       core_is_extension := false;
+       END IF;
+
        IF liblwgeomver != relproc THEN
                fullver = fullver || ' (liblwgeom version mismatch: "' || liblwgeomver || '")';
        END IF;
@@ -2919,9 +2930,6 @@ BEGIN
                fullver = fullver || ' LIBPROTOBUF="' || protobuf_lib_ver || '"';
        END IF;
 
-       -- fullver = fullver || ' DBPROC="' || dbproc || '"';
-       -- fullver = fullver || ' RELPROC="' || relproc || '"';
-
        IF dbproc != relproc THEN
                fullver = fullver || ' (core procs from "' || dbproc || '" need upgrade)';
        END IF;
@@ -2931,6 +2939,12 @@ BEGIN
                IF topo_scr_ver != relproc THEN
                        fullver = fullver || ' (topology procs from "' || topo_scr_ver || '" need upgrade)';
                END IF;
+               IF core_is_extension AND NOT EXISTS (
+                       SELECT * FROM pg_catalog.pg_extension
+                       WHERE extname = 'postgis_topology')
+               THEN
+                               fullver = fullver || ' [UNPACKAGED!]';
+               END IF;
        END IF;
 
        IF rast_lib_ver IS NOT NULL THEN