1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Support regular expressions in pg_ident.conf.

This commit is contained in:
Magnus Hagander
2008-11-28 14:26:58 +00:00
parent 2939e20037
commit 5d2a1a41d0
3 changed files with 140 additions and 13 deletions

View File

@ -1,4 +1,4 @@
<!-- $PostgreSQL: pgsql/doc/src/sgml/client-auth.sgml,v 1.113 2008/11/20 20:45:29 momjian Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/client-auth.sgml,v 1.114 2008/11/28 14:26:58 mha Exp $ -->
<chapter id="client-authentication">
<title>Client Authentication</title>
@ -595,6 +595,19 @@ local db1,db2,@demodbs all md5
There is no restriction regarding how many database users a given
operating system user can correspond to, nor vice versa.
</para>
<para>
If the <replaceable>system-username</> field starts with a slash (<literal>/</>),
the contents of the field is treated as a regular expression. This regular
expression supports a single capture, which can be back-referenced as
<literal>\1</> (backslash-one). This allows the mapping of different syntax
names with a single line.
<programlisting>
mymap /(.*)@mydomain.com \1
mymap /(.*)@otherdomain.com guest
</programlisting>
will "remove" the domain part for users with system usernames @mydomain.com, and
allow all users from @otherdomain.com to log in as guest.
</para>
<para>
The <filename>pg_ident.conf</filename> file is read on start-up and