Re: Fix GetOperatorFromCompareType

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Paul A Jungwirth <pj(at)illuminatedcomputing(dot)com>
Cc: Neil Chen <carpenter(dot)nail(dot)cz(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Fix GetOperatorFromCompareType
Date: 2026-01-05 02:46:03
Message-ID: CAApHDvoi6FL3gD4B=bNqjds9iKtvAYo_cCBGUvk3xGUmycwb4w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 21 Nov 2025 at 05:45, Paul A Jungwirth
<pj(at)illuminatedcomputing(dot)com> wrote:
> Thanks for the review! Here is a patch with your suggestions incorporated.

I had a look at this. I agree the code could be made simpler, but I
don't see any window for "potentially using uninitialized Oids to
build error messages". I think you must be talking about the final
ERROR message using opfamily and opcintype, but it seems to me like
the call to get_opclass_method() would ERROR if the opclass couldn't
be found and there's no window for the opclass to be removed before
the call to get_opclass_opfamily_and_input_type() as we don't process
catcache invalidations in between.

That makes me think there's no live issue here, so it's more just
about a cleanup and simplification.

I split your patch into two and wrote a comment to explain about
ERRORs are raised on failed lookups. We should likely fix that in v18
since the comment is misleading, but for 0002, since nothing seems
broken, then it seems safer just to do that one in master.

What do you think?

David

Attachment Content-Type Size
v3-0001-Fix-misleading-comment-for-GetOperatorFromCompare.patch text/plain 1.4 KB
v3-0002-Simplify-GetOperatorFromCompareType-code.patch text/plain 3.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2026-01-05 03:28:32 Re: virtual generated column as partition key
Previous Message Peter Smith 2026-01-05 02:44:55 Re: [PROPOSAL] Termination of Background Workers for ALTER/DROP DATABASE