Re: tiny step toward threading: reduce dependence on setlocale()

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>, Andreas Karlsson <andreas(at)proxel(dot)se>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: tiny step toward threading: reduce dependence on setlocale()
Date: 2024-08-13 17:56:07
Message-ID: 96d51fbb8b6f338a210cee97abb63c0162bcb781.camel@j-davis.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 2024-08-13 at 17:11 +0200, Peter Eisentraut wrote:

> They used to be completely separate from
> pg_newlocale_from_collation(),
> but now they are just mostly a thin wrapper around it.  Except there
> is
> some hardcoded handling of C_COLLATION_OID and POSIX_COLLATION_OID. 
> Do
> we care about that?

...

> However, it's not clear whether the hardcoded handling of some
> collations is needed for performance parity or perhaps some
> bootstrapping reasons.  It would be useful to get that cleared up.
> Thoughts?

There's at least one place where we expect lc_collate_is_c() to work
without catalog access at all: libpq/hba.c uses regexes with
C_COLLATION_OID.

But I don't think that's a major problem -- we can just move the
hardcoded test into pg_newlocale_from_collation() and return a
predefined struct with collate_is_c/ctype_is_c already set.

+1.

Regards,
Jeff Davis

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Imseih (AWS), Sami 2024-08-13 18:12:30 Re: Restart pg_usleep when interrupted
Previous Message Robert Haas 2024-08-13 17:19:34 Re: pg_verifybackup: TAR format backup verification