Proposal: wildcards in pg_service.conf - Mailing list pgsql-hackers

From Albe Laurenz
Subject Proposal: wildcards in pg_service.conf
Date
Msg-id D960CB61B694CF459DCFB4B0128514C2F3442B@exadv11.host.magwien.gv.at
Whole thread Raw
Responses Re: Proposal: wildcards in pg_service.conf  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I'd like to extend the libpq service file by allowing
wildcards, e.g. like this:

[%]
host=dbhost.mycompany.com
dbname=%

Such an entry would match all service parameters,
and all ocurrences of the wildcard right of a = would
be replaced with the service parameter.

That implies that a [%] entry is only useful as last entry
in pg_service.conf.

I'd like to keep it simple and only accept standalone
wildcards (not things like 'prefix%suffix'), but that's
debatable (at the cost of more work).

As a special case, I would want to allow wildcards in LDAP URLs
like this:

[%]
ldap://ldap.mycompany.com/cn=%,cn=databases?connectstring?one?objectclass=*

This also explains my preference of '%' over '*' as a
wildcard to avoid problems with * in LDAP filter expressions.

The added value is that you don't need one line per database
in the configuration file.

The two examples above illustrate two cases where I think that
such a setup could be useful:
a) You have "most of" your databases in one cluster.
b) You use LDAP to store your connection parameters centrally.

What do you think?

Yours,
Laurenz Albe

pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: OSSP can be used in the windows environment now!
Next
From: "Hiroshi Saito"
Date:
Subject: Re: OSSP can be used in the windows environment now!