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 cbe16b204af8c288c965051cd98243182aacee5e.camel@j-davis.com
Whole thread Raw
In response to Re: tiny step toward threading: reduce dependence on setlocale()  (Alexander Kukushkin <cyberdemn@gmail.com>)
List pgsql-hackers
On Thu, 2025-09-25 at 11:31 +0200, Alexander Kukushkin wrote:
> Hi Jeff,
>
> On Thu, 25 Sept 2025 at 11:08, Jeff Davis <pgsql@j-davis.com> wrote:
> > Committed v2-0001.
> >
>
>
> 06421b084364 commit broke possibility to
> call GetSharedSecurityLabel() from ClientAuthentication_hook.
> Now GetSharedSecurityLabel() calls fail with the error "cannot read
> pg_class without having selected a database".

...

> pg_shseclabel.provider data type is TEXT with collation C.
> When doing btree lookup by (objoid, classoid, provider) we need to
> take into account collation.
> varstr_cmp() was used to make an exception for C collation, and now
> it has to do a cache lookup for pg_collation to determine that this
> is a C collation.
> However, caches are not yet initialized at the moment
> when ClientAuthentication_hook is executed, and they can't be,
> because database access is not yet allowed.
>
> Or, in other words, this commit made shared pg_catalog relations
> depend on non shared relations.

Thank you, patch attached, intended for backport to 18.

Are you aware of any way to encounter this bug without using an
extension?

Regards,
    Jeff Davis


Attachment

pgsql-hackers by date:

Previous
From: Quan Zongliang
Date:
Subject: Re: Include extension path on pg_available_extensions
Next
From: Peter Smith
Date:
Subject: Re: POC: enable logical decoding when wal_level = 'replica' without a server restart