[postgis-tickets] r17206 - Partially revert r17180
Raul
raul at rmr.ninja
Tue Jan 22 01:09:36 PST 2019
Author: algunenano
Date: 2019-01-22 01:09:35 -0800 (Tue, 22 Jan 2019)
New Revision: 17206
Modified:
branches/2.5/extensions/postgis_extension_helper.sql
branches/2.5/postgis/postgis.sql.in
Log:
Partially revert r17180
It changed the behaviour of _postgis_pgsql_version
Now uses the appropiate 5-6 digit version from server_version_num
References #4296
References #4303
Modified: branches/2.5/extensions/postgis_extension_helper.sql
===================================================================
--- branches/2.5/extensions/postgis_extension_helper.sql 2019-01-22 09:07:16 UTC (rev 17205)
+++ branches/2.5/extensions/postgis_extension_helper.sql 2019-01-22 09:09:35 UTC (rev 17206)
@@ -33,7 +33,7 @@
var_class := CASE WHEN lower(param_type) = 'function' OR lower(param_type) = 'aggregate' THEN 'pg_proc' ELSE '' END;
var_is_aggregate := CASE WHEN lower(param_type) = 'aggregate' THEN true ELSE false END;
- IF var_pgsql_version < 110 THEN
+ IF var_pgsql_version < 110000 THEN
var_sql_list := $sql$SELECT 'ALTER EXTENSION ' || e.extname || ' DROP ' || $3 || ' ' || COALESCE(proc.proname || '(' || oidvectortypes(proc.proargtypes) || ')' ,typ.typname, cd.relname, op.oprname,
cs.typname || ' AS ' || ct.typname || ') ', opcname, opfname) || ';' AS remove_command
FROM pg_depend As d INNER JOIN pg_extension As e
Modified: branches/2.5/postgis/postgis.sql.in
===================================================================
--- branches/2.5/postgis/postgis.sql.in 2019-01-22 09:07:16 UTC (rev 17205)
+++ branches/2.5/postgis/postgis.sql.in 2019-01-22 09:09:35 UTC (rev 17206)
@@ -2808,7 +2808,8 @@
CREATE OR REPLACE FUNCTION _postgis_pgsql_version() RETURNS text
AS $$
- SELECT current_setting('server_version_num');
+ SELECT CASE WHEN split_part(s,'.',1)::integer > 9 THEN split_part(s,'.',1) || '0' ELSE split_part(s,'.', 1) || split_part(s,'.', 2) END AS v
+ FROM substring(version(), 'PostgreSQL ([0-9\.]+)') AS s;
$$ LANGUAGE 'sql' STABLE;
-- Availability: 2.5.0
More information about the postgis-tickets
mailing list