Commit cb703716 authored by Raúl Marín's avatar Raúl Marín

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



git-svn-id: http://svn.osgeo.org/postgis/branches/2.5@17206 b70326c6-7e19-0410-871a-916f4a2858ee
parent 61ec9869
Pipeline #44273311 passed with stage
in 22 minutes and 46 seconds
......@@ -33,7 +33,7 @@ BEGIN
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
......
......@@ -2808,7 +2808,8 @@ CREATE OR REPLACE FUNCTION _postgis_scripts_pgsql_version() RETURNS text
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment