Re: db alias - Mailing list pgsql-general

From Albe Laurenz
Subject Re: db alias
Date
Msg-id D960CB61B694CF459DCFB4B0128514C207F81289@exadv11.host.magwien.gv.at
Whole thread Raw
In response to db alias  ("Gauthier, Dave" <dave.gauthier@intel.com>)
List pgsql-general
Dave Gauthier wrote:
> Is there a way to alias a db name for purposes of redirecting
connections?   For example, you have 2
> DBs, DBX and DBY. The users always connect to a DB alias called
"USEDB".   USEDB points to DBX today,
> changed to point to DBY tomorrow, transparent to the users.

That can easily be done using a connection service file on the client:
http://www.postgresql.org/docs/current/static/libpq-pgservice.html

Then you'd connect with "service=usedb".

To change the definition, you'd have to edit the file on the client.
If you don't want to modify the file on the client, you can use LDAP
connection parameter lookup:
http://www.postgresql.org/docs/current/static/libpq-ldap.html

That way you can change the definition centrally on the LDAP server.

Yours,
Laurenz Albe


pgsql-general by date:

Previous
From: "Albe Laurenz"
Date:
Subject: Re: Partitioning Advice
Next
From: "Albe Laurenz"
Date:
Subject: Re: acessibility for tables