Re: make tsearch use the database default locale - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: make tsearch use the database default locale
Date
Msg-id ff1717b21d1eec839acae2152993771015f1b2e1.camel@j-davis.com
Whole thread Raw
In response to Re: make tsearch use the database default locale  (Peter Eisentraut <peter@eisentraut.org>)
List pgsql-hackers
On Fri, 2025-10-17 at 18:15 +0200, Peter Eisentraut wrote:
>
> This is indeed a bit mysterious.  AFAICT, the behavior you describe
> is
> conditional on if (prs->usewide), so it apparently depends also on
> the
> encoding?  I'm not sure if the new code covers this.

I believe the new code does cover this case:

Previously, the code was effectively:
   if (prs->usewide && prs->pgwstr != NULL && c > 0x7f)
      retirm nonascii

and the new code is:
   if (prs->charmaxlen > 1 && locale->ctype_is_c && wc > 0x7f)
      return nonascii;

unless I missed something, those are equivalent.

> After this patch set, char2wchar() can become a local function in
> pg_locale_libc.c.  (But we still need wchar2char() externally, so
> maybe
> it's not worth changing this (yes).)

Done.

The rest of the patches are rebased with no other changes. I plan to
commit soon.

Regards,
    Jeff Davis


Attachment

pgsql-hackers by date:

Previous
From: Corey Huinker
Date:
Subject: Re: Extended Statistics set/restore/clear functions.
Next
From: Corey Huinker
Date:
Subject: Re: Import Statistics in postgres_fdw before resorting to sampling.