From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael@paquier.xyz>
Cc: Jonathan S. Katz <jkatz@postgresql.org>
Cc: David Rowley <dgrowleyml@gmail.com>
Cc: exclusion@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18240: Undefined behaviour in cash_mul_flt8() and friends
Date: Mon, 25 Dec 2023 10:58:59 -0500
Message-ID: <1851211.1703519939@sss.pgh.pa.us> (raw)
In-Reply-To: <ZYlSJREbhM_qNZIT@paquier.xyz>
References: <ZXbi3xo7QhQIe1YN@paquier.xyz>
<2171714.1702307153@sss.pgh.pa.us>
<ZXgh74Ykj3iWvXKr@paquier.xyz>
<CAApHDvrBLa=gQ0tCg8727RaZXWDg1sDvFJ2+-DVy5SC=NSSKkg@mail.gmail.com>
<2433182.1702391878@sss.pgh.pa.us>
<ZX1rmhppwgaczYQ7@paquier.xyz>
<3453263.1702739958@sss.pgh.pa.us>
<ecdf4a19-e97d-42c8-be45-fb5a46166160@postgresql.org>
<1673413.1703442075@sss.pgh.pa.us>
<ZYjSZZu1UGUlXWXa@paquier.xyz>
<ZYlSJREbhM_qNZIT@paquier.xyz>
Michael Paquier <michael@paquier.xyz> writes:
> Looking at that, I can see that Peter has added a few tests to test
> the predictability of plans generated with non-hashable types, and
> that these are based on money. See 6dd8b0080787.
> One possible pick to replace money for these tests is tsvector, that
> cannot be hashed and has an equality operator. Perhaps these had
> better be replaced anyway?
Hm. A quick check in pg_opclass shows that these are the types that
currently have btree but not hash opclasses:
# select ob.opcintype::regtype from (select * from pg_opclass where opcmethod = 403) ob
left join (select * from pg_opclass where opcmethod = 405) oh using(opcintype) where oh.opcintype is null;
opcintype
-------------
bit
bit varying
money
tsvector
tsquery
(5 rows)
I'm a little nervous about using tsvector or tsquery, as it seems
pretty plausible that somebody would get around to making hash
support for them someday. Perhaps the same argument could be made
about bit or varbit, but I'd bet a lot less on that happening,
as those are backwater-ish types (not even in the standard
anymore, IIRC). So I'd think about using one of those.
Or we could build a for-test-purposes-only datatype, but that
could require a lot of scaffolding work.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, michael@paquier.xyz, jkatz@postgresql.org, dgrowleyml@gmail.com, exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18240: Undefined behaviour in cash_mul_flt8() and friends
In-Reply-To: <1851211.1703519939@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox