Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wdlpH-004KuI-1F for pgsql-bugs@arkaria.postgresql.org; Sun, 28 Jun 2026 09:29:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wdlpE-00GBfp-1l for pgsql-bugs@arkaria.postgresql.org; Sun, 28 Jun 2026 09:29:16 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wdf2o-00FzA3-35 for pgsql-bugs@lists.postgresql.org; Sun, 28 Jun 2026 02:14:50 +0000 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wdf2n-00000000YCK-1Aem for pgsql-bugs@lists.postgresql.org; Sun, 28 Jun 2026 02:14:50 +0000 Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-695f6438518so3166321a12.0 for ; Sat, 27 Jun 2026 19:14:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1782612887; cv=none; d=google.com; s=arc-20260327; b=KD+KJkC+8TbR2HR0Byg+mXBIh+7Ig+FuaPseFuY/ZGZYWgUpSKPdEGH7j/tqBZCIRn cyklQtBMF6iHR1jmKh4Tz6aUV46u688ME6pAaOWzuzGchf2d+3iIY43iiqzAB1PqOw5g wPYBm/yAcTVhkiEX90N7MkVnUplQGwvujZkof8psqKfwH3xzDopwEDOT4t8E/NMvybGp hf7a/qvM/wiMzlW8qz1UP5VQM5Y9lHxR2TMU+qxns6jTSWrnE9ZNo/brXYIiNyeuwPLr KwbQXOFhTUkiabBRed68XJfqfG2XL9CGEkkE9HC+qw31NiHyoZGORvXjNOD+VfIfvUvX IyLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=to:subject:message-id:date:from:mime-version:dkim-signature; bh=q95GEcg3WcL6EmUMF7IEDqB1x+9Pk/Ee4U2xQJr53eg=; fh=/gQe77b11iMZdcPj/nJr/Ghqi6rQp5FPrPbdO93bmOA=; b=UVqhtQE9rVOEfcpAbCVCS3+UX2BtGyRin9/VzPjGPlSlHEdZEX8gRiPyxhG/MCdw0T sXglJCmTVUQ495lXa4UkEGmgHx0f2rSwy7NWbrdY9VOTcbsuiMTjbAWkUpPxES8P6Q+Y TgR/1nmRpy5lY8544wUKt0/KvoRefVc3D0YkuTNQyL3aLBBMATWZAgh45h2fH1Q4EqKu LszNanKm0EFDgZ4s45nt92JoetilDUCBbja9SBBrA+RGmQpQDiPW1kzlVBz62mV4u5kW f9VaYGP2I/zND+SdzGc4uea3KOHghXyYSZqIzbCWwEDekVLpMIViz9XDGgsgU00wP9kr 5Ttw==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782612887; x=1783217687; darn=lists.postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=q95GEcg3WcL6EmUMF7IEDqB1x+9Pk/Ee4U2xQJr53eg=; b=hZY3hth5LHofIe34Q/fLkE0W+pQIi4g/QDQuBTkB3pXNONjk88p+Ew28HXSSrt9m3/ y0O/K/96jbS9EPhwbMPcc79yRE8PmS18AF2uUHEVxXGYgI2PYRDnn2uU1W+fHXSSLEWl JMIAUmQyLgLNV2WiSZZtrFgNBh1K7edejksgkLVYvJVFr16DtmvZygqwZiTj3H9rdTxx m/W8GYbV9GaiNslulAKq8ly35BL64qKf/FDG93F+5p1WNDrJ+OZQRu5hNXMjNHVg+VD/ ykLer5kHvIbN3kcFfXOL8Fv0aEgGE7SFO7JU2/CSybvDPkkKG+jJMqO8buj5Bsz0KvPN nn2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782612887; x=1783217687; h=to:subject:message-id:date:from:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=q95GEcg3WcL6EmUMF7IEDqB1x+9Pk/Ee4U2xQJr53eg=; b=BsYfKmHFvRg61vW32kxVz0tqz7nnkBU++dRJ4T4EPfc7umqDgxI8SgHPxAZWMCyIX8 hqdhJmpqKQZEn38WoDp68o09wav6upx0L/0+MpgM6u8Y9t0v2pEr87lftnCjFO55Re92 Ocq8b2vyxedHC+K+kCm0rCspeuTBz2c2mnasF5hLEitQRAPBPXDWQPvRrH97SPdvSu9t sDIilTbVQWYjiINylsEApZ2vlWNg0mc6/5gnDTvNiYk4+U3rdnf5CrsEZPbG/xPepRZl DgoHUv0X/gAs6Uc6hgAAaW3iebH4POrRbF3v/Q7ord9clGxPaVBqlXMDcQdl8YBjWTkX Rvlw== X-Gm-Message-State: AOJu0Yz2/e+0LgpK4Z6q4qg5wCBiuaPh+QWPqwzVe3ySuaMmRTJ/NS32 BhPNq3QiOUBVvogiJp4fXGkXV+nTZymPDePqPatj/CVYO05u1maR2abI5PfhOsxSK4mXVBDAJeE O68QDPNUbVjK4QdsA42AEST41XouPOoT/5K1Q X-Gm-Gg: AfdE7clUlV+kyMEtICtX9ZGm4CdPcdVWntoXD/z3I58d2mFBZ+oTuUhKQxHmwKOjYb0 nNnYehIgeVxWFE7E4gAwVdhi0uPDSn5pGkc/ncEDgjuZAwrE5+M/wjWpuJ7S0vJzxnprjOooKna WRmlA36qrfu9tkM+IW2QE2fRM2whBfoIg2T0xDVOQF91Fs6uhgSeKUrtM0FdSrJ5lhla/nxN3Bw WhVNfalP6wzE0fUGELDYArvpgJXwok10j3tB4oXXDKXanUwxvwnhVmH9uVS5kw1BhsZXF1cs50A zRBHY+OMTIrXLtX5SO32kV9qrzDkq7358XIl2gMG X-Received: by 2002:a05:6402:449a:b0:698:3b7b:e48e with SMTP id 4fb4d7f45d1cf-6983b7bec8emr2549092a12.36.1782612887002; Sat, 27 Jun 2026 19:14:47 -0700 (PDT) MIME-Version: 1.0 From: Bill Kim Date: Sun, 28 Jun 2026 11:14:35 +0900 X-Gm-Features: AVVi8CcVQJzFLkGDtMA7fsycO1_Qe3ps_CcKTC5xncw-adxCCsjmHs0i30NzirE Message-ID: Subject: BUG #19524: NaN handling in btree_gist's float4/float8 opclasses To: pgsql-bugs@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000e6e412065546e763" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000e6e412065546e763 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi all, I have a patch for this and `make check` passes (core + all contrib, plus new btree_gist NaN cases covering the three scenarios in the report). Posting here first in case someone is already further along =E2=80=94 if = not, I'll send it to pgsql-hackers and register it in the open CF in a couple of days. The fix swaps the five gbt_float{4,8}{gt,ge,eq,le,lt} comparators and gbt_float{4,8}key_cmp for the NaN-aware float{4,8}_* helpers and float{4,8}_cmp_internal() from utils/float.h =E2=80=94 same total order t= he btree opclass already uses. No on-disk change. Bill --000000000000e6e412065546e763 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
=C2=A0Hi all,

=C2=A0 I have a patch for this and `m= ake check` passes (core + all contrib, plus
=C2=A0 new btree_gist NaN ca= ses covering the three scenarios in the report).
=C2=A0 Posting here fir= st in case someone is already further along =E2=80=94 if not,
=C2=A0 I&#= 39;ll send it to pgsql-hackers and register it in the open CF in a couple=C2=A0 of days.

=C2=A0 The fix swaps the five gbt_float{4,8}{gt,ge= ,eq,le,lt} comparators and
=C2=A0 gbt_float{4,8}key_cmp for the NaN-awar= e float{4,8}_* helpers and
=C2=A0 float{4,8}_cmp_internal() from utils/f= loat.h =E2=80=94 same total order the
=C2=A0 btree opclass already uses.= No on-disk change.

=C2=A0 Bill
--000000000000e6e412065546e763--