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

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

Reply via email to