Re: correction suggestion for https://www.postgresql.org/docs/17/auth-username-maps.html
David G. Johnston <david.g.johnston@gmail.com>
From: "David G. Johnston" <david.g.johnston@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: alexey.shishkin@enterprisedb.com, pgsql-docs@lists.postgresql.org
Date: 2025-07-13T19:27:09Z
Lists: pgsql-docs
On Sun, Jul 13, 2025 at 11:30 AM Tom Lane <tgl@sss.pgh.pa.us> wrote: > I figured out how to make the 003_peer.pl tests for \1 less > hacky, and pushed that. Here's a proposed patch for the > documentation side of things, including your suggestion to > make pg_ident.conf.sample match up better. > > Thanks. My goal of trying to be a bit more precise regarding the \1 reference is probably counter-productive. The existing wording makes me ask "why" to which the answer is "because if database-username is a regexp a reference to \1 resolves to any capturing groups it defines; and if there are none the regexp will be malformed and break when you attempt to reload pg_hba.conf". But that is a lot of words for something that is unlikely to be encountered in practice and does distract the reader from the main point. (Likewise, the system-username regexp can contain more than one capture - which are only available later in the system-username regexp - though again it seems unlikely anyone is going to use that feature in this context.) I'm good with this. Thanks! David J.
Commits
-
Doc: clarify description of regexp fields in pg_ident.conf.
- ff6783ce5260 16.10 landed
- f8ce5dea433c 18.0 landed
- dc70816fde6e 13.22 landed
- b70a2e8a1a0d 17.6 landed
- 6f7d016e917e 14.19 landed
- 5fe55a0fe40e 19 (unreleased) landed
- 2132ced7dc97 15.14 landed
-
In username-map substitution, cope with more than one \1.
- 3c4e26a62c31 19 (unreleased) landed