[postgis-tickets] r17204 - Revert r17178

Raul raul at rmr.ninja
Tue Jan 22 01:02:30 PST 2019


Author: algunenano
Date: 2019-01-22 01:02:30 -0800 (Tue, 22 Jan 2019)
New Revision: 17204

Modified:
   branches/2.3/NEWS
   branches/2.3/postgis/postgis.sql.in
Log:
Revert r17178

It changes the behaviour of _postgis_pgsql_version

References #4303



Modified: branches/2.3/NEWS
===================================================================
--- branches/2.3/NEWS	2019-01-21 23:18:14 UTC (rev 17203)
+++ branches/2.3/NEWS	2019-01-22 09:02:30 UTC (rev 17204)
@@ -10,10 +10,8 @@
   - #4290, More robust distance calculations in geography (Paul Ramsey)
   - #4267, Enable Proj 6 deprecated APIs (Darafei Praliaskouski, Raúl Marín)
   - #4275, Avoid passing a NULL pointer to GEOSisEmpty (Raúl Marín)
-  - #4296, Use `server_version_num` instead of parsing `version()` (Raúl Marín)
   - #4298, Geodetic tolerance issue in 32-bit (Paul Ramsey)
 
-
 PostGIS 2.3.8
 2018/11/24
 

Modified: branches/2.3/postgis/postgis.sql.in
===================================================================
--- branches/2.3/postgis/postgis.sql.in	2019-01-21 23:18:14 UTC (rev 17203)
+++ branches/2.3/postgis/postgis.sql.in	2019-01-22 09:02:30 UTC (rev 17204)
@@ -2848,7 +2848,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;
 
 CREATE OR REPLACE FUNCTION postgis_full_version() RETURNS text



More information about the postgis-tickets mailing list