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

Sandro Santilli strk at kbt.io
Sat Mar 11 02:27:16 PST 2017


ST_IsValid simply prints those "reasons to be invalid" as NOTICE messages
so the statement should *NOT* be interrupted.

What client are you using to send those queries to PostgreSQL ?
Can you reproduce the interruption ?

Note that you could use ST_IsValidDetail to have a more terse
output (and more detail, if needed).

--strk;


On Sat, Mar 11, 2017 at 10:43:36AM +0100, Björn Harrtell wrote:
> I would also expect a list of ids. I've never seen ST_IsValid fail like
> that so it might be a bug. It would be helpful if you can provide the
> geometry to reproduce this case.
> 
> /Björn
> 
> 2017-03-06 12:21 GMT+01:00 Thomas Müller <Thomas.Mueller at ksc-it.de>:
> 
> > Hello,
> >
> >
> >
> > 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
> >
> > _______________________________________________
> > postgis-users mailing list
> > postgis-users at lists.osgeo.org
> > https://lists.osgeo.org/mailman/listinfo/postgis-users
> >


More information about the postgis-users mailing list