Lists: | pgsql-general |
---|
From: | "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com> |
---|---|
To: | "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | db alias |
Date: | 2012-06-05 18:59:41 |
Message-ID: | 0AD01C53605506449BA127FB8B99E5E10F18D9AE@FMSMSX105.amr.corp.intel.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
Hi: I think I know the answer to this, but the desire/need is great enough to get confirmation here.
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.
From: | Guillaume Lelarge <guillaume(at)lelarge(dot)info> |
---|---|
To: | "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com> |
Cc: | "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: db alias |
Date: | 2012-06-05 19:04:50 |
Message-ID: | 1338923090.1845.1.camel@localhost.localdomain |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
On Tue, 2012-06-05 at 18:59 +0000, Gauthier, Dave wrote:
> Hi: I think I know the answer to this, but the desire/need is great enough to get confirmation here.
>
> 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.
PostgreSQL doesn't give you that, but pgBouncer may be the tool you're
looking for.
--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com
From: | "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at> |
---|---|
To: | "Gauthier, Dave *EXTERN*" <dave(dot)gauthier(at)intel(dot)com>, <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: db alias |
Date: | 2012-06-06 07:14:58 |
Message-ID: | D960CB61B694CF459DCFB4B0128514C207F81289@exadv11.host.magwien.gv.at |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | 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