pgsql-hackers
❮
Separators in pg_hosts.conf fields
- Jump to comment-1Noah Misch<noah@leadboat.com>Apr 26, 2026, 9:33 PM UTCIf the build directory name contains a comma,
src/test/modules/sslpassphrasecallback fails on master since commit 4f43302.
It fails because hba.c:next_token() treats a comma as a token separator:
* Tokens can be delimited by double quotes (this allows the inclusion of
* commas, blanks, and '#', but not newlines). As in SQL, write two
* double-quotes to represent a double quote.
Commit 4f43302 documented the pg_hosts.conf hostname field as a
comma-separated list, but not the other fields. Should other pg_hosts.conf
fields continue to require quoting around commas, or not?- Jump to comment-1Daniel Gustafsson<daniel@yesql.se>Apr 26, 2026, 9:40 PM UTC
On 26 Apr 2026, at 23:32, Noah Misch <noah@leadboat.com> wrote:
Ugh, thanks for reporting.
If the build directory name contains a comma,
src/test/modules/sslpassphrasecallback fails on master since commit 4f43302.
It fails because hba.c:next_token() treats a comma as a token separator:* Tokens can be delimited by double quotes (this allows the inclusion of
Yes, only the hostname field is a comma-separated list. I think this should be
* commas, blanks, and '#', but not newlines). As in SQL, write two
* double-quotes to represent a double quote.
Commit 4f43302 documented the pg_hosts.conf hostname field as a
comma-separated list, but not the other fields. Should other pg_hosts.conf
fields continue to require quoting around commas, or not?
added to the documentation as well on top of the test fix in your patch. Do
you want me to take care of both parts?
--
Daniel Gustafsson- Jump to comment-1Noah Misch<noah@leadboat.com>Apr 26, 2026, 9:54 PM UTCOn Sun, Apr 26, 2026 at 11:40:13PM +0200, Daniel Gustafsson wrote:
On 26 Apr 2026, at 23:32, Noah Misch <noah@leadboat.com> wrote:
If the build directory name contains a comma,
src/test/modules/sslpassphrasecallback fails on master since commit 4f43302.
It fails because hba.c:next_token() treats a comma as a token separator:
Ugh, thanks for reporting.* Tokens can be delimited by double quotes (this allows the inclusion of
* commas, blanks, and '#', but not newlines). As in SQL, write two
* double-quotes to represent a double quote.
Commit 4f43302 documented the pg_hosts.conf hostname field as a
comma-separated list, but not the other fields. Should other pg_hosts.conf
fields continue to require quoting around commas, or not?
Do you anticipate docs like "this isn't a list, but the file's general parsing
Yes, only the hostname field is a comma-separated list. I think this should be
added to the documentation as well on top of the test fix in your patch.
rules require quotes if there's a comma"? Or something different?Do
That's fine. I also don't mind pushing what I sent.
you want me to take care of both parts?- Jump to comment-1Daniel Gustafsson<daniel@yesql.se>Apr 26, 2026, 10:01 PM UTC
On 26 Apr 2026, at 23:54, Noah Misch <noah@leadboat.com> wrote:
On Sun, Apr 26, 2026 at 11:40:13PM +0200, Daniel Gustafsson wrote:
Yes, only the hostname field is a comma-separated list. I think this should be
added to the documentation as well on top of the test fix in your patch.
Something along those lines yes.
Do you anticipate docs like "this isn't a list, but the file's general parsing
rules require quotes if there's a comma"? Or something different?Do you want me to take care of both parts?
+1, please do.
That's fine. I also don't mind pushing what I sent.
--
Daniel Gustafsson