Re: Allow continuations in "pg_hba.conf" files

From: David Zhang <david(dot)zhang(at)highgo(dot)ca>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, postgresql(dot)org(at)coelho(dot)net
Subject: Re: Allow continuations in "pg_hba.conf" files
Date: 2020-04-02 18:05:17
Message-ID: e02f9ad7-e2b0-9a11-9c81-4294315e7ddc@highgo.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020-04-01 10:25 p.m., Fabien COELHO wrote:

>
> Hello,
>
>> FWIW, I don't think so. Generally a trailing backspace is an escape
>> character for the following newline.  And '\ ' is a escaped space,
>> which is usualy menas a space itself.
>>
>> In this case escape character doesn't work generally and I think it
>> is natural that a backslash in the middle of a line is a backslash
>> character itself.
>
> I concur: The backslash char is only a continuation as the very last
> character of the line, before cr/nl line ending markers.

+Agree. However, it would nice to update the sentence below if I
understand it correctly.

"+   Comments, whitespace and continuations are handled in the same way
as in" pg_hba.conf

For example, if a user provide a configuration like below (even such a
comments is not recommended)

"host    all     all     127.0.0.1/32    trust  #COMMENTS, it works"

i.e. the original pg_hba.conf allows to have comments in each line, but
with new continuation introduced, the comments has to be put to the last
line.

>
> There are no assumption about backslash escaping, quotes and such,
> which seems reasonable given the lexing structure of the files, i.e.
> records of space-separated words, and # line comments.
>
--
David

Software Engineer
Highgo Software Inc. (Canada)
www.highgo.ca

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2020-04-02 18:10:31 Re: bad wal on replica / incorrect resource manager data checksum in record / zfs
Previous Message Andres Freund 2020-04-02 18:01:09 Re: Should we add xid_current() or a int8->xid cast?