[postgis-users] ST_IsValid() terminates on invalid geometry with State XX000

Thomas Müller Thomas.Mueller at ksc-it.de
Mon Mar 6 03:21:31 PST 2017


When importing Openstreetmap data in a Nominatim database on Ubuntu 14.04, Postgres 9.6, Postgis  2.3.2 there was a record with an invalid geometry. When doing

select place_id
from placex
where st_isvalid(geometry)=false

I expected to get a list with the ids of all invalid records. Instead the Statement terminates on hitting the invalid record with a  SQL state: XX000 + Explanation why the geometry is invalid (Sorry for not noting it).
To get the actual id of the record I had to manually binary search over the ids. Luckily there was only one defect.
Is this really by design (and no other way)? Just listing all records with invalid geometries seems to be a quite useful query.

Thanks in advance
Thomas Müller
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20170306/d487149f/attachment.html>

More information about the postgis-users mailing list