Re: btree_gist: Fix NaN handling in float4 and float8 opclasses - Mailing list pgsql-hackers

From Tender Wang
Subject Re: btree_gist: Fix NaN handling in float4 and float8 opclasses
Date
Msg-id CAHewXNkxQXK+47Du_veTqg5nkOPtkLRAi7-eb9svBNJLR7o3kw@mail.gmail.com
Whole thread
In response to btree_gist: Fix NaN handling in float4 and float8 opclasses  (Ewan Young <kdbase.hack@gmail.com>)
Responses Re: btree_gist: Fix NaN handling in float4 and float8 opclasses
List pgsql-hackers
Ewan Young <kdbase.hack@gmail.com> 于2026年6月17日周三 16:40写道:
>
> Hi,
>
> A GiST index on a float4/float8 column (via btree_gist) can silently
> omit rows containing NaN, returning different results from a sequential
> scan:
>
>     CREATE EXTENSION btree_gist;
>     CREATE TABLE t (a float8);
>     INSERT INTO t SELECT 1 FROM generate_series(1, 1000);
>     INSERT INTO t SELECT 'NaN' FROM generate_series(1, 1000);
>     CREATE INDEX ON t USING gist (a);
>
>     SET enable_seqscan = on;
>     SELECT count(*) FROM t WHERE a = 'NaN';   -- 1000
>     SET enable_seqscan = off;
>     SELECT count(*) FROM t WHERE a = 'NaN';   -- 0  (wrong)
>

It seems the issue you reported is the same as [1].
Please double-check.

[1] https://www.postgresql.org/message-id/19501-3bff3bbc97f1e7c9%40postgresql.org


--
Thanks,
Tender Wang



pgsql-hackers by date:

Previous
From: Ajin Cherian
Date:
Subject: Re: [PATCH] Preserve replication origin OIDs in pg_upgrade
Next
From: Etsuro Fujita
Date:
Subject: Re: use of SPI by postgresImportForeignStatistics