Re: Avoid is possible a expensive function call (src/backend/utils/adt/varlena.c) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Avoid is possible a expensive function call (src/backend/utils/adt/varlena.c)
Date
Msg-id 3904331.1709594928@sss.pgh.pa.us
Whole thread Raw
In response to Re: Avoid is possible a expensive function call (src/backend/utils/adt/varlena.c)  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Avoid is possible a expensive function call (src/backend/utils/adt/varlena.c)
List pgsql-hackers
Michael Paquier <michael@paquier.xyz> writes:
> On Mon, Mar 04, 2024 at 03:08:03PM -0300, Ranier Vilela wrote:
>> I can't see any user validation at the function pg_newlocale_from_collation.

> Matthias is right, look closer.  I can see more than one check,
> especially note the one related to the collation version mismatch that
> should not be silently ignored.

The fast path through that code doesn't include any checks, true,
but the point is that finding the entry proves that we made those
checks previously.  I can't agree with making those semantics
squishy in order to save a few cycles in the exact-equality case.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Add new error_action COPY ON_ERROR "log"
Next
From: Jeff Davis
Date:
Subject: Re: [PATCH] updates to docs about HOT updates for BRIN