<div dir="ltr">Hello,<div><br></div><div>I am using Ubuntu 12.04 with the official PostgreSQL apt repo (via <a href="https://wiki.postgresql.org/wiki/Apt">https://wiki.postgresql.org/wiki/Apt</a>). I am running into an easily reproducible issue, and was hoping for some help to solve this.</div>
<div><br></div><div>When using ST_Intersects() not all rows that intersect are returned. This was not the case in previous versions that we have upgraded from.</div><div><br></div><div>These are the steps to reproduce on a fresh install of Ubuntu 12.04 with all packages updated and PostGIS/PostgreSQL 9.3 installed:</div>
<div><br></div><div><div><font face="courier new, monospace">test=# CREATE TABLE test (id serial, condition_geo geography);</font></div><div><font face="courier new, monospace">CREATE TABLE</font></div><div><font face="courier new, monospace">test=# INSERT INTO test (condition_geo) VALUES (ST_Buffer(ST_GeogFromWKB(ST_MakePoint(20.0,30.0)),10.0));</font></div>
<div><font face="courier new, monospace">INSERT 0 1</font></div><div><font face="courier new, monospace">test=# SELECT id FROM test WHERE ST_Intersects("condition_geo", ST_Buffer(ST_GeogFromText('POINT(20.0 30.0)'), 20.0)) IS TRUE;</font></div>
<div><font face="courier new, monospace"> id</font></div><div><font face="courier new, monospace">----</font></div><div><font face="courier new, monospace"> 1</font></div><div><font face="courier new, monospace">(1 row)</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">test=# INSERT INTO test (condition_geo) VALUES (ST_Buffer(ST_GeogFromWKB(ST_MakePoint(20.0,30.0)),10.0));</font></div><div>
<font face="courier new, monospace">INSERT 0 1</font></div><div><font face="courier new, monospace">test=# SELECT id FROM test WHERE ST_Intersects("condition_geo", ST_Buffer(ST_GeogFromText('POINT(20.0 30.0)'), 20.0)) IS TRUE;</font></div>
<div><font face="courier new, monospace"> id</font></div><div><font face="courier new, monospace">----</font></div><div><font face="courier new, monospace"> 1</font></div><div><font face="courier new, monospace">(1 row)</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">test=# SELECT id FROM test WHERE ST_Intersects("condition_geo", ST_Buffer(ST_GeogFromText('POINT(20.0 30.0)'), 20.0)) IS TRUE AND id = 2;</font></div>
<div><font face="courier new, monospace"> id</font></div><div><font face="courier new, monospace">----</font></div><div><font face="courier new, monospace"> 2</font></div><div><font face="courier new, monospace">(1 row)</font></div>
</div><div><br></div><div>Note that the SELECT should return both rows 1 and 2 in the first SELECT.</div><div><br></div><div>Any thoughts?</div><div><br></div><div><br></div></div>