Re: tiny step toward threading: reduce dependence on setlocale() - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: tiny step toward threading: reduce dependence on setlocale()
Date
Msg-id 96d51fbb8b6f338a210cee97abb63c0162bcb781.camel@j-davis.com
Whole thread Raw
In response to Re: tiny step toward threading: reduce dependence on setlocale()  (Peter Eisentraut <peter@eisentraut.org>)
Responses Re: tiny step toward threading: reduce dependence on setlocale()
List 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




pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: pg_verifybackup: TAR format backup verification
Next
From: "Imseih (AWS), Sami"
Date:
Subject: Re: Restart pg_usleep when interrupted