The load tries to ensure it's the load of the _old_ library that fails,
rather than the one of the _new_ library.
A failed load of the old library would make major version check resort
to call the postgis_scripts_installed() which would contain the correct
version since version 1.1.0 up. Load of the old library should only fail
when the old library is 2.1.0 up so there's no problem there.
NOTE: Failure of loading the _new_ library could still happen if the upgrade
script is loaded in a session in which the _old_ library was used already.
This is not something we can fix as there's no "unload" command in PostgreSQL.
Closes #2382
git-svn-id: http://svn.osgeo.org/postgis/trunk@12641
b70326c6-7e19-0410-871a-
916f4a2858ee
my $sql_file = $ARGV[0];
my $module = 'postgis';
+my $soname = '';
my $version_to = "";
my $version_to_num = 0;
my $version_from = $ARGV[1];
{
$module = 'postgis_raster';
}
+ elsif (m@('\$libdir/[^']*')@)
+ {
+ $soname = $1;
+ }
}
close(INPUT);
};
+print "LOAD $soname;\n" if ($soname);
+
print "BEGIN;\n";
print "SET search_path TO $schema;\n" if $schema;