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-09T18:39:24Z
Lists: pgsql-docs

Attachments

On Wed, Jul 9, 2025 at 9:22 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:

> "David G. Johnston" <david.g.johnston@gmail.com> writes:
> > On Wed, Jul 9, 2025 at 7:56 AM PG Doc comments form <
> noreply@postgresql.org>
> > wrote:
> >> Pls. let me suggest the correction for the
> >> https://www.postgresql.org/docs/17/auth-username-maps.html page.
> >> It has the following sentence:
>
> The existing sentence is pretty mangled English, though.
>

Agreed.


>   When the database-username field is a regular expression, it is
>   not possible to use \1 within it to refer to a capture from
>   the system-username field.
>
> Thoughts?
>

Its good as far a narrow fix goes.

But how about the attached?  More invasive but covers the salient points
better, IMO, and less repetitive than having the two fields have their own
basically copy-pasted paragraphs.

I didn't add an example but felt the point "be referenced a single time
within" to be needed since, usefulness not withstanding, writing \1\1 for
database-username works but only the first instance of \1 is replaced.

Also, should we attempt to align this documentation and
pg_ident.conf.sample as pertains to pg-username vs. database-username?

David J.

Commits

  1. Doc: clarify description of regexp fields in pg_ident.conf.

  2. In username-map substitution, cope with more than one \1.