Re: Show inline comments from pg_hba lines in the pg_hba_file_rules view

From: Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Show inline comments from pg_hba lines in the pg_hba_file_rules view
Date: 2023-09-01 09:32:35
Message-ID: 0d4ceb7d-0b26-7ad4-d63b-2cb3abd6b413@uni-muenster.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Michael

On 01.09.23 03:18, Michael Paquier wrote:
> hba.c is complex enough these days (inclusion logic, tokenization of
> the items) that I am not in favor of touching its code paths for
> anything like that. This is not something that can apply only to
> pg_hba.conf, but to all configuration files.
It is indeed possible to extrapolate it to any configuration file, but
my point was rather to visualize comments purposefully left by the DBA
regarding user access (pg_hba and pg_ident).
> And this touches in
> adding support for a second type of comment format. This is one of
> these areas where we may want a smarter version of pg_read_file that
> returns a SRF for (line_number, line_contents) of a file read? Note
> that it is possible to add comments at the end of a HBA entry already,
> like:
> local all all trust # My comment, and this is a correct HBA entry.

I also considered parsing the inline #comments - actually it was my
first idea - but I thought it would leave no option to make an inline
comment without populating pg_hba_file_rules. But I guess in this case
one could always write the comment in the line above :)

Would you be in favor of parsing #comments instead? Given that # is
currently already being parsed (ignored), it shouldn't add too much
complexity to the code.

Thanks for the feedback.

Jim

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zhijie Hou (Fujitsu) 2023-09-01 09:36:25 Fix a typo in decode.c
Previous Message Peter Eisentraut 2023-09-01 09:30:57 Re: SQL:2011 application time