<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Fellow PostGISers, <br>
</p>
<p>I have two environments. </p>
<p>select Version()<br>
<b> "PostgreSQL 10.9 on x86_64-pc-linux-gnu, compiled by gcc
(GCC) 4.8.5 20150623 (Red Hat 4.8.5-36), 64-bit"</b><br>
select PostGIS_Full_Version()<br>
<b> "POSTGIS=""2.5.3 r17699"" [EXTENSION] PGSQL=""100""
GEOS=""3.8.0-CAPI-1.13.1 "" PROJ=""Rel. 6.2.1, November 1st,
2019"" GDAL=""GDAL 3.0.2, released 2019/10/28"" LIBXML=""2.9.1""
LIBJSON=""0.11"" LIBPROTOBUF=""1.0.2"" RASTER"</b></p>
<p>And.<br>
</p>
<p><b>"PostgreSQL 13.3, compiled by Visual C++ build 1914, 64-bit"</b><b><br>
</b><b> "POSTGIS=""3.1.2 3.1.2"" [EXTENSION] PGSQL=""130""
GEOS=""3.9.1-CAPI-1.14.1"" SFCGAL=""1.3.8"" PROJ=""7.1.1""
LIBXML=""2.9.9"" LIBJSON=""0.12"" LIBPROTOBUF=""1.2.1""
WAGYU=""0.5.0 (Internal)"" TOPOLOGY"</b><br>
</p>
<p>I have written the following function: </p>
<p>CREATE OR REPLACE FUNCTION spdba.STSquarifyLine(p_line geometry)<br>
RETURNS geometry<br>
LANGUAGE 'plpgsql'<br>
IMMUTABLE <br>
SECURITY DEFINER<br>
AS <br>
blah...</p>
<p>The function does no calculations per se, it only swaps
ordinates. <br>
</p>
<p>PostGIS functions used are:</p>
<p>ST_MakeLine / ST_SetSRID ST_MakePoint ST_X / ST_Y /
ST_GeomFromEWKT</p>
<p>The function does call another small function:</p>
<p>create or replace function spdba.STGeneralDirection(p_geom
geometry)<br>
returns varchar(2)<br>
LANGUAGE 'plpgsql'<br>
IMMUTABLE<br>
SECURITY DEFINER<br>
as<br>
.... (It uses Uses ST_BoundingRectangle ST_X ST_Y ST_StartPoint
ST_EndPoint)</p>
<p>This function returns the same result on both databases for a
bunch of different inputs. Happy that it works as I wish.<br>
</p>
<p>However if I execute the STSquarifyLine function on the Linux box
for a particular input, I get what I consider to be the "right"
result. When I execute the same function with the same parameter
value on the Windows box I do not get the same result. (I have
played around with IMMUTABLE and VOLATILE but these make no
difference.)</p>
<p>I know this is a bit vague but any tips as to what may be going
on?</p>
<p>I am happy to supply the functions source (via email) if anyone
is willing to help.<br>
</p>
<p>regards</p>
<p> Simon</p>
<p><br>
</p>
</body>
</html>