[postgis-users] Incorrect operator definition for box2df type

Kohei KaiGai kaigai at heterodb.com
Sun Aug 9 21:39:42 PDT 2020


Hello,

I noticed the following operator definitions.

gistest=# select o.oid,oprname,oprleft::regtype,oprright::regtype,oprcode,prosrc
            from pg_operator o, pg_proc p
           where o.oprcode = p.oid and p.prosrc =
'gserialized_contains_box2df_box2df_2d';
  oid  | oprname | oprleft | oprright |        oprcode         |
         prosrc
-------+---------+---------+----------+------------------------+---------------------------------------
 80884 | &&      | box2df  | box2df   | public.overlaps_2d     |
gserialized_contains_box2df_box2df_2d
 80886 | @       | box2df  | box2df   | public.is_contained_2d |
gserialized_contains_box2df_box2df_2d
 80885 | ~       | box2df  | box2df   | public.contains_2d     |
gserialized_contains_box2df_box2df_2d
(3 rows)

It means all of the &&(box2df,box2df), @(box2df,box2df) and
~(box2df,box2df) calls
identical logic even though they should perform as different operators.
Fortunately, here is no functions that return box2df type, so it is
not easy to reproduce
any problems, however, it is confusing to understand the PostGIS implementation.

Best regards,
-- 
HeteroDB, Inc / The PG-Strom Project
KaiGai Kohei <kaigai at heterodb.com>


More information about the postgis-users mailing list