From 74db9341b8bd085f4904c7a23ece646d14df5fc0 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Thu, 24 Oct 2013 15:56:22 +0000 Subject: [PATCH] Use postgis_scripts_installed to fetch installed version if lib_version fails 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 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/utils/postgis_proc_upgrade.pl b/utils/postgis_proc_upgrade.pl index efa817559..928455725 100755 --- a/utils/postgis_proc_upgrade.pl +++ b/utils/postgis_proc_upgrade.pl @@ -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); -- 2.50.1