[postgis-tickets] [PostGIS] #5175: <> and != on geometry yield operator is not unique
PostGIS
trac at osgeo.org
Mon Jun 27 16:58:52 PDT 2022
#5175: <> and != on geometry yield operator is not unique
----------------------+---------------------------
Reporter: robe | Owner: pramsey
Type: defect | Status: new
Priority: medium | Milestone: PostGIS 3.2.2
Component: postgis | Version: 3.2.x
Resolution: | Keywords:
----------------------+---------------------------
Description changed by robe:
Old description:
> Reported on IRC someone trying to create a trigger with construct:
>
> {{{
> (NEW.geom != OLD.geom)
> }}}
>
> yielded != is not unique for geometry.
> had to resort to
>
> {{{
> (NEW.geom::text != OLD.geom::text)
> }}}
>
> I verified it is an issue with
>
> {{{
> SELECT ST_Point(1,2) != ST_Point(3,4);
> SELECT ST_Point(1,2) <> ST_Point(3,4);
> }}}
>
> However this works fine:
>
> {{{
> SELECT ST_Point(1,2)::geography != ST_Point(3,4)::geography;
> SELECT ST_Point(1,2)::geography <> ST_Point(3,4)::geography;
> }}}
>
> I haven't verified where the extra operator indirection is coming from
> that is not effecting geography as well.
New description:
Reported on IRC someone trying to create a trigger with construct:
{{{
(NEW.geom != OLD.geom)
}}}
yielded != is not unique for geometry.
had to resort to
{{{
(NEW.geom::text != OLD.geom::text)
}}}
I verified it is an issue with
{{{
SELECT ST_Point(1,2) != ST_Point(3,4);
SELECT ST_Point(1,2) <> ST_Point(3,4);
}}}
However this works fine:
{{{
SELECT ST_Point(1,2)::geography != ST_Point(3,4)::geography;
SELECT ST_Point(1,2)::geography <> ST_Point(3,4)::geography;
}}}
I haven't verified where the extra operator indirection is coming from
that is not effecting geography as well.
Note that:
{{{
SELECT ST_Point(1,2) = ST_Point(3,4);
SELECT NOT (ST_Point(1,2) = ST_Point(3,4)) ;
}}}
work without error
--
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5175#comment:1>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-tickets
mailing list