<div><br></div>Your code below works for me also. It's obviously just my data.<div><br></div><div>the field is data type bytea:</div><div><br></div><div>\x010300000000000000</div><div><br></div><div>I ran: </div><div><br>
</div><div>select st_astext(the_geom) from tbl where id = 6052</div><div><br></div><div>and it returns:  "POLYGON EMPTY"</div><div><br></div><div>When I run the st_isvalid on it:</div><div><br></div><div>select st_isvalid(the_geom) from tbl where id = 6052</div>
<div>or</div><div>select st_isvalid(the_geom::geometry) from tbl where id = 6052
</div><div><br></div><div>It throws the segmentation error.</div><div><br></div><div>I just upgrade to postgis 1.5.5 and this made no difference.</div><div><br></div><div><br><div class="gmail_quote">On Wed, Jul 25, 2012 at 2:10 PM, Sandro Santilli <span dir="ltr"><<a href="mailto:strk@keybit.net" target="_blank">strk@keybit.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Wed, Jul 25, 2012 at 01:02:59PM +0100, Rebecca Clarke wrote:<br>
> I have resolved the issue.<br>
><br>
> It was happening because there was a record with an empty polygon.<br>
><br>
> When I added this code into the query it worked successfully.<br>
><br>
> CASE WHEN ST_IsEmpty(st_astext(the_geom)) THEN false ELSE<br>
> st_isvalid(the_geom) END<br>
<br>
</div>So are you saying that ST_IsValid('POLYGON EMPTY'::geometry) and<br>
ST_Contains('POLYGON EMPTY'::geometry, 'POLYGON EMPTY'::geometry)<br>
both crash for you ?<br>
<br>
They work fine for me as of PostGIS 1.5.4<br>
<div class="im HOEnZb"><br>
--strk;<br>
<br>
  ,------o-.<br>
  |   __/  |    Delivering high quality PostGIS 2.1<br>
  |  / 2.1 |    <a href="http://strk.keybit.net" target="_blank">http://strk.keybit.net</a> - <a href="http://vizzuality.com" target="_blank">http://vizzuality.com</a><br>
  `-o------'<br>
<br>
</div><div class="HOEnZb"><div class="h5">_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
</div></div></blockquote></div><br></div>