Proposal: wildcards in pg_service.conf

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: Proposal: wildcards in pg_service.conf
Date: 2008-02-27 12:41:18
Message-ID: D960CB61B694CF459DCFB4B0128514C2F3442B@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hiroshi Saito 2008-02-27 12:46:14 Re: OSSP can be used in the windows environment now!
Previous Message Magnus Hagander 2008-02-27 11:47:15 Re: OSSP can be used in the windows environment now!