]> granicus.if.org Git - postgis/commitdiff
Use postgis_scripts_installed to fetch installed version if lib_version fails
authorSandro Santilli <strk@keybit.net>
Thu, 24 Oct 2013 15:56:22 +0000 (15:56 +0000)
committerSandro Santilli <strk@keybit.net>
Thu, 24 Oct 2013 15:56:22 +0000 (15:56 +0000)
Soft-uprading from 1.0 to any other 1.x would still fail unless the
old 1.0 library is around. See #2510

git-svn-id: http://svn.osgeo.org/postgis/trunk@12053 b70326c6-7e19-0410-871a-916f4a2858ee

utils/postgis_proc_upgrade.pl

index efa81755940809e65856bbf86829c0cf74ea9c70..92845572541460c06299c6422984d55c1b830d91 100755 (executable)
@@ -345,7 +345,12 @@ BEGIN
        -- postgis_lib_version() and postgis_scripts_installed()
        -- would both return actual PostGIS release number.
        -- 
-       SELECT into old_scripts postgis_lib_version();
+       BEGIN
+               SELECT into old_scripts postgis_lib_version();
+       EXCEPTION WHEN OTHERS THEN
+               RAISE DEBUG ''Got %'', SQLERRM;
+               SELECT into old_scripts postgis_scripts_installed();
+       END;
        SELECT into new_scripts ''NEWVERSION'';
        SELECT into old_maj substring(old_scripts from 1 for 2);
        SELECT into new_maj substring(new_scripts from 1 for 2);