Inconsistent results from seqscan and gist indexscan - Mailing list pgsql-hackers

From Richard Guo
Subject Inconsistent results from seqscan and gist indexscan
Date
Msg-id CAMbWs4-C9K-8V=cAY7q0ciZmJKBMiUnp_xBGzxgKpEWPKd0bng@mail.gmail.com
Whole thread Raw
Responses Re: Inconsistent results from seqscan and gist indexscan
List pgsql-hackers
Here is how it can be reproduced.

create table point_tbl (f1 point);

insert into point_tbl(f1) values ('(5.1, 34.5)');
insert into point_tbl(f1) values (' ( Nan , NaN ) ');
analyze;

create index gpointind on point_tbl using gist (f1);

set enable_seqscan to on;
set enable_indexscan to off;
# select * from point_tbl where f1 <@ polygon '(0,0),(0,100),(100,100),(100,0),(0,0)';
     f1
------------
 (5.1,34.5)
 (NaN,NaN)
(2 rows)


set enable_seqscan to off;
set enable_indexscan to on;
# select * from point_tbl where f1 <@ polygon '(0,0),(0,100),(100,100),(100,0),(0,0)';
     f1
------------
 (5.1,34.5)
(1 row)

Seems point_inside() does not handle NaN properly.

BTW, I'm using 15devel. But this issue can be seen in at least 12
version also.

Thanks
Richard

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Postgres restart in the middle of exclusive backup and the presence of backup_label file
Next
From: Michael Paquier
Date:
Subject: Re: pg_waldump stucks with options --follow or -f and --stats or -z