public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tom Lane <[email protected]>
To: Laurenz Albe <[email protected]>
Cc: [email protected]
Subject: Re: Making the ENUM operators LEAKPROOF
Date: Wed, 01 Jul 2026 18:33:45 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
Laurenz Albe <[email protected]> writes:
> This is an attempt to get the operators from the "enum_ops" operator
> class LEAKPROOF.
I think we should reject this idea. Our standard for marking
functions leakproof has always included a requirement that the amount
of code involved be small enough that one can immediately confirm that
there is no information leak. I don't think that enum_cmp() can meet
that standard; the length of your argument already proves the point.
The issue here is not really "can I convince myself that it's safe
today?". It's more about "am I willing to bet that no future code
change is going to unintentionally break the property?". The more
code involved, the riskier that bet.
I know that you are going to say "but text_cmp covers a lot of
ground, including code (in libc or ICU) that isn't even ours".
To my mind, we made an exception for text_cmp because the performance
consequences of not making it leakproof were unacceptable.
I do not think enum_cmp() can clear that bar either.
FWIW, I do agree that marking enum_eq leakproof is safe. How
many of the use-cases you are worried about would be satisfied
with that?
regards, tom lane
view thread (2+ messages)
reply
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: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Making the ENUM operators LEAKPROOF
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox