Re: Allow file inclusion in pg_hba and pg_ident files

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Julien Rouhaud <rjuju123(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Nathan Bossart <nathandbossart(at)gmail(dot)com>
Subject: Re: Allow file inclusion in pg_hba and pg_ident files
Date: 2022-11-10 01:29:40
Message-ID: Y2xUBJ+S+Z0zbxRW@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 09, 2022 at 12:09:01PM +0800, Julien Rouhaud wrote:
> On Wed, Nov 09, 2022 at 09:51:17AM +0900, Michael Paquier wrote:
>> Julien, please note that this is waiting on author for now. What do
>> you think about the now-named v18-0001 and the addition of an
>> ErrorContextCallback to provide more information about the list of
>> included files on error?
>
> Yes, I'm unfortunately fully aware that it's waiting on me. I've been a bit
> busy this week with $work but I will try to go back to it as soon as I can,
> hopefully this week!

FWIW, I have been playing with the addition of a ErrorContextCallback
in tokenize_auth_file(), and this addition leads to a really nice
result. With this method, it is possible to know the full chain of
events leading to a failure when tokenizing included files, which is
not available now in the logs when reloading the server.

We could extend it to have more verbose information by passing more
arguments to tokenize_auth_file(), still I'd like to think that just
knowing the line number and the full path to the file is more than
enough once you know the full chain of events. 0001 and 0002 ought to
be merged together, but I am keeping these separate to show how simple
the addition of the ErrorContextCallback is.
--
Michael

Attachment Content-Type Size
v19-0001-Invent-open_auth_file-in-hba.c-to-refactor-auth-.patch text/x-diff 9.0 KB
v19-0002-Add-error-context-callback-when-tokenizing-HBA-f.patch text/x-diff 2.5 KB
v19-0003-Allow-file-inclusion-in-pg_hba-and-pg_ident-file.patch text/x-diff 55.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2022-11-10 01:32:46 Re: HOT chain validation in verify_heapam()
Previous Message LEO HSU 2022-11-10 01:10:52 Re: [PATCH] Support % wildcard in extension upgrade filenames