Re: Allow continuations in "pg_hba.conf" files - Mailing list pgsql-hackers

From David Zhang
Subject Re: Allow continuations in "pg_hba.conf" files
Date
Msg-id e02f9ad7-e2b0-9a11-9c81-4294315e7ddc@highgo.ca
Whole thread Raw
In response to Re: Allow continuations in "pg_hba.conf" files  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: Allow continuations in "pg_hba.conf" files
List 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




pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Should we add xid_current() or a int8->xid cast?
Next
From: Andres Freund
Date:
Subject: Re: bad wal on replica / incorrect resource manager data checksum inrecord / zfs