<div dir="ltr">Ok I understand what you mean. <br>If I follow you the = operator should cast topogeom to geom and perform the regular geom=geom operation?<div><br></div><div>I modified the = operator to become the topogeom==topogeom</div>
<div><br></div><div>Cheers,</div><div>Rémi</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra" style="font-family:arial,sans-serif;font-size:12.666666984558105px">
_second an == operator for topogeometry<br></div><div class="gmail_extra" style="font-family:arial,sans-serif;font-size:12.666666984558105px"><div class="gmail_extra"><br></div></div><blockquote style="font-family:arial,sans-serif;font-size:12.666666984558105px;margin:0px 0px 0px 40px;border:none;padding:0px">
<div class="gmail_extra"><div class="gmail_extra">--creating the egal operator for topology.topogeometry type</div></div><div class="gmail_extra"><div class="gmail_extra">DROP FUNCTION IF EXISTS topology.topogeometry_egal(tg1 topology.topogeometry,tg2 topology.topogeometry) CASCADE;</div>
</div><div class="gmail_extra"><div class="gmail_extra">CREATE FUNCTION topology.topogeometry_egal(tg1 topology.topogeometry,tg2 topology.topogeometry)</div></div><div class="gmail_extra"><div class="gmail_extra"> RETURNS boolean AS</div>
</div><div class="gmail_extra"><div class="gmail_extra"> $BODY$</div></div><div class="gmail_extra"><div class="gmail_extra"><span style="white-space:pre-wrap"> </span>-- This function returns true if every field of topogeom1 are egal to topogeom2 (int = meaning) in the same order, false else.</div>
</div><div class="gmail_extra"><div class="gmail_extra"><span style="white-space:pre-wrap"> </span>--returns null if any field is NULL, whatever the others.</div></div><div class="gmail_extra"><div class="gmail_extra"><span style="white-space:pre-wrap"> </span>DECLARE</div>
</div><div class="gmail_extra"><div class="gmail_extra"><span style="white-space:pre-wrap"> </span>BEGIN</div></div><div class="gmail_extra"><div class="gmail_extra"><span style="white-space:pre-wrap"> </span>--<span style="white-space:pre-wrap"> </span>RETURN </div>
</div><div class="gmail_extra"><div class="gmail_extra"><span style="white-space:pre-wrap"> </span>--<span style="white-space:pre-wrap"> </span>(tg1).topology_id=(tg2).topology_id </div></div><div class="gmail_extra"><div class="gmail_extra">
<span style="white-space:pre-wrap"> </span>--<span style="white-space:pre-wrap"> </span>AND (tg1).layer_id=(tg2).layer_id </div></div><div class="gmail_extra"><div class="gmail_extra"><span style="white-space:pre-wrap"> </span>--<span style="white-space:pre-wrap"> </span>AND (tg1).id=(tg2).id </div>
</div><div class="gmail_extra"><div class="gmail_extra"><span style="white-space:pre-wrap"> </span>--<span style="white-space:pre-wrap"> </span>AND (tg1).type=(tg2).type;</div></div><div class="gmail_extra"><div class="gmail_extra">
<span style="white-space:pre-wrap"> </span>RETURN tg1::int[]=tg2::int[];</div></div><div class="gmail_extra"><div class="gmail_extra"><span style="white-space:pre-wrap"> </span>END;</div></div><div class="gmail_extra">
<div class="gmail_extra"> $BODY$</div></div><div class="gmail_extra"><div class="gmail_extra">LANGUAGE plpgsql IMMUTABLE;</div></div><div class="gmail_extra"><div class="gmail_extra"><br></div></div><div class="gmail_extra">
<div class="gmail_extra">CREATE OPERATOR == (</div></div><div class="gmail_extra"><div class="gmail_extra"> leftarg = topology.topogeometry,</div></div><div class="gmail_extra"><div class="gmail_extra"> rightarg = topology.topogeometry,</div>
</div><div class="gmail_extra"><div class="gmail_extra"> procedure = topology.topogeometry_egal,</div></div><div class="gmail_extra"><div class="gmail_extra"> commutator = ==</div></div><div class="gmail_extra"><div class="gmail_extra">
);</div></div></blockquote></div></div>