Re: Add cleanup parsing contexts for pg_hba and pg_ident files - Mailing list pgsql-hackers

From Tofig Aliev
Subject Re: Add cleanup parsing contexts for pg_hba and pg_ident files
Date
Msg-id 4f646695e4a7c538e286108244e46565@postgrespro.ru
Whole thread
List pgsql-hackers
Michael Paquier писал(а) 2026-07-21 14:54:
> On Tue, Jul 21, 2026 at 02:41:08PM +0700, Tofig Aliev wrote:
>> Background processes calling load_hba()/load_ident() may see
>> undefined behavior because PostmasterContext is already gone.
>> This patch adds proper context cleanup to prevent this issue.
> 
> Why would you want to do that?  I don't necessarily object to a change
> like that, just wondering why somebody would be interesting in calling
> these APIs from a bgworker context.
> --
> Michael

Michael, thank you for your answer.

This fix simply enables background processes to load pg_hba and pg_ident 
files safely, without undefined behavior. This also includes processes 
loaded through shared_preload_libraries, whose logic can be very 
diverse.

regards,
Tofig Aliev



pgsql-hackers by date:

Previous
From: Tofig Aliev
Date:
Subject: Add cleanup parsing contexts for pg_hba and pg_ident files
Next
From: Zsolt Parragi
Date:
Subject: injection_points: canceled or terminated waiters leak their wait slots