[postgis-tickets] r17207 - Partially revert r17181
Raul
raul at rmr.ninja
Tue Jan 22 01:10:22 PST 2019
Author: algunenano
Date: 2019-01-22 01:10:21 -0800 (Tue, 22 Jan 2019)
New Revision: 17207
Modified:
trunk/extensions/postgis_extension_helper.sql
trunk/postgis/postgis.sql.in
Log:
Partially revert r17181
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: trunk/extensions/postgis_extension_helper.sql
===================================================================
--- trunk/extensions/postgis_extension_helper.sql 2019-01-22 09:09:35 UTC (rev 17206)
+++ trunk/extensions/postgis_extension_helper.sql 2019-01-22 09:10:21 UTC (rev 17207)
@@ -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: trunk/postgis/postgis.sql.in
===================================================================
--- trunk/postgis/postgis.sql.in 2019-01-22 09:09:35 UTC (rev 17206)
+++ trunk/postgis/postgis.sql.in 2019-01-22 09:10:21 UTC (rev 17207)
@@ -2854,7 +2854,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