Opened 2 months ago

Closed 7 weeks ago

Last modified 7 weeks ago

#5815 closed defect (fixed)

hash operator error

Reported by: robe Owned by: pramsey
Priority: blocker Milestone: PostGIS 3.5.1
Component: postgis Version: 3.4.x
Keywords: Cc:

Description

On IRC velix mentioned this bug in PostGIS 3.5.0.

I haven't tested prior versions but I suspect is a regression.

To generate the error:

WITH lines AS (SELECT ST_GeomFromText('LINESTRING(1 2, 3 4)') AS geom
UNION ALL 
SELECT  ST_GeomFromText('LINESTRING(6 5, 7 8)') AS geom
)
SELECT t1.geom, t2.geom
FROM lines AS t1, lines AS t2
WHERE t1.geom <> t2.geom;

Error is - I think hash operator id might change

ERROR:  could not find hash function for hash operator 1192459 

Change History (8)

comment:1 by robe, 2 months ago

Summary: hash operator errorhash operator error with <> !=

comment:2 by robe, 2 months ago

Version: 3.4.x3.5.x

comment:3 by strk, 2 months ago

Summary: hash operator error with <> !=hash operator error
Version: 3.5.x3.4.x

Interesting, I can reproduce with

POSTGIS="3.6.0dev 3.5.0-32-g511435a7d"

comment:4 by pramsey, 7 weeks ago

New and exciting error. On 3.4 it's a different error. So this may have never worked, and is now just failing in a different way.

postgis34=# WITH lines AS (SELECT ST_GeomFromText('LINESTRING(1 2, 3 4)') AS geom
 UNION ALL 
  SELECT  ST_GeomFromText('LINESTRING(6 5, 7 8)') AS geom
 ) 
 SELECT t1.geom, t2.geom
 FROM lines AS t1, lines AS t2
 WHERE t1.geom <> t2.geom;

ERROR:  operator is not unique: geometry <> geometry
LINE 7: WHERE t1.geom <> t2.geom;                      ^
HINT:  Could not choose a best candidate operator. You might need to add explicit type casts.

in reply to:  4 comment:5 by robe, 7 weeks ago

Replying to pramsey:

New and exciting error. On 3.4 it's a different error. So this may have never worked, and is now just failing in a different way.

postgis34=# WITH lines AS (SELECT ST_GeomFromText('LINESTRING(1 2, 3 4)') AS geom
 UNION ALL 
  SELECT  ST_GeomFromText('LINESTRING(6 5, 7 8)') AS geom
 ) 
 SELECT t1.geom, t2.geom
 FROM lines AS t1, lines AS t2
 WHERE t1.geom <> t2.geom;

ERROR:  operator is not unique: geometry <> geometry
LINE 7: WHERE t1.geom <> t2.geom;                      ^
HINT:  Could not choose a best candidate operator. You might need to add explicit type casts.

I think the addition of the operator you added in 3.5, that was the error we used to get

see https://git.osgeo.org/gitea/postgis/postgis/src/branch/stable-3.5/NEWS#L111

So I think the fix for #5175 is what is causing this error

comment:6 by Paul Ramsey <pramsey@…>, 7 weeks ago

In 0b4dc6f/git:

Remove false guarantees of hashes/merges from ≠ operator, references #5815

comment:7 by pramsey, 7 weeks ago

Resolution: fixed
Status: newclosed

comment:8 by Paul Ramsey <pramsey@…>, 7 weeks ago

In 49df3d0/git:

Remove false guarantees of hashes/merges from ≠ operator, references #5815

Note: See TracTickets for help on using tickets.