Re: Avoid is possible a expensive function call (src/backend/utils/adt/varlena.c)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>, Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Avoid is possible a expensive function call (src/backend/utils/adt/varlena.c)
Date: 2024-03-04 23:28:48
Message-ID: 3904331.1709594928@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Michael Paquier <michael(at)paquier(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2024-03-04 23:32:19 Re: [PATCH] updates to docs about HOT updates for BRIN
Previous Message Michael Paquier 2024-03-04 23:18:29 Re: Add new error_action COPY ON_ERROR "log"