Skip to content

Commit b70a2e8

Browse files
committed
Doc: clarify description of regexp fields in pg_ident.conf.
The grammar was a little shaky and confusing here, so word-smith it a bit. Also, adjust the comments in pg_ident.conf.sample to use the same terminology as the SGML docs, in particular "DATABASE-USERNAME" not "PG-USERNAME". Back-patch appropriate subsets. I did not risk changing pg_ident.conf.sample in released branches, but it still seems OK to change it in v18. Reported-by: Alexey Shishkin <alexey.shishkin@enterprisedb.com> Author: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: David G. Johnston <david.g.johnston@gmail.com> Discussion: https://postgr.es/m/175206279327.3157504.12519088928605422253@wrigleys.postgresql.org Backpatch-through: 13
1 parent 5a2139a commit b70a2e8

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

doc/src/sgml/client-auth.sgml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -984,8 +984,9 @@ local db1,db2,@demodbs all md5
984984
the remainder of the field is treated as a regular expression.
985985
(See <xref linkend="posix-syntax-details"/> for details of
986986
<productname>PostgreSQL</productname>'s regular expression syntax.) The regular
987-
expression can include a single capture, or parenthesized subexpression,
988-
which can then be referenced in the <replaceable>database-username</replaceable>
987+
expression can include a single capture, or parenthesized subexpression.
988+
The portion of the system user name that matched the capture can then
989+
be referenced in the <replaceable>database-username</replaceable>
989990
field as <literal>\1</literal> (backslash-one). This allows the mapping of
990991
multiple user names in a single line, which is particularly useful for
991992
simple syntax substitutions. For example, these entries
@@ -1003,12 +1004,11 @@ mymap /^(.*)@otherdomain\.com$ guest
10031004
<para>
10041005
If the <replaceable>database-username</replaceable> field starts with
10051006
a slash (<literal>/</literal>), the remainder of the field is treated
1006-
as a regular expression (see <xref linkend="posix-syntax-details"/>
1007-
for details of <productname>PostgreSQL</productname>'s regular
1008-
expression syntax). It is not possible to use <literal>\1</literal>
1009-
to use a capture from regular expression on
1010-
<replaceable>system-username</replaceable> for a regular expression
1011-
on <replaceable>database-username</replaceable>.
1007+
as a regular expression.
1008+
When the <replaceable>database-username</replaceable> field is a regular
1009+
expression, it is not possible to use <literal>\1</literal> within it to
1010+
refer to a capture from the <replaceable>system-username</replaceable>
1011+
field.
10121012
</para>
10131013

10141014
<tip>

0 commit comments

Comments
 (0)