Re: [GENERAL] DB alias ?

2014-03-23 Thread Adrian Klaver
On 03/23/2014 06:22 PM, Tim Uckun wrote: How can this be combined with other commands. For example pgsql doesn't like this psql service=test1 -d test_database -c "some command" But it would like this: http://www.postgresql.org/docs/9.3/static/app-psql.html "An alternative way to specify conn

Re: [GENERAL] DB alias ?

2014-03-23 Thread Tim Uckun
How can this be combined with other commands. For example pgsql doesn't like this psql service=test1 -d test_database -c "some command" the PGSERVICE=test1 psql blah blah works but seems cumbersome. Why isn't there a psql --service=blah option? On Thu, Jan 24, 2013 at 9:48 PM, Guillaume Lela

Re: [GENERAL] DB alias ?

2013-01-24 Thread Albe Laurenz
Dave Gauthier wrote: > I would have suggested to use pg_services file as documented at > > http://www.postgresql.org/docs/9.1/static/libpq-pgservice.html > http://www.postgresql.org/docs/9.1/static/libpq-connect.html > > You can think of this as tnsnames replacement. > > but I am unable to make

Re: [GENERAL] DB alias ?

2013-01-24 Thread Gauthier, Dave
From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Shridhar Daithankar Sent: Wednesday, January 23, 2013 10:32 PM To: pgsql-general@postgresql.org Cc: Gauthier, Dave; Rob Sargent Subject: Re: [GENERAL] DB alias ? On Wednesday, January 23, 2013 09

Re: [GENERAL] DB alias ?

2013-01-24 Thread Albe Laurenz
Guillaume Lelarge wrote: > On Thu, 2013-01-24 at 09:01 +0530, Shridhar Daithankar wrote: > > On Wednesday, January 23, 2013 09:39:43 PM Gauthier, Dave wrote: > > > Then someone who wants to look at old JAN data will have the same problem > > > :-( > > > > > > If I recall, Oracle enables something l

Re: [GENERAL] DB alias ?

2013-01-24 Thread Guillaume Lelarge
On Thu, 2013-01-24 at 09:01 +0530, Shridhar Daithankar wrote: > On Wednesday, January 23, 2013 09:39:43 PM Gauthier, Dave wrote: > > Then someone who wants to look at old JAN data will have the same problem > > :-( > > > > If I recall, Oracle enables something like this. Multiple tnsfilenames (or

Re: [GENERAL] DB alias ?

2013-01-23 Thread Shridhar Daithankar
On Wednesday, January 23, 2013 09:39:43 PM Gauthier, Dave wrote: > Then someone who wants to look at old JAN data will have the same problem > :-( > > If I recall, Oracle enables something like this. Multiple tnsfilenames (or > something like that). There was a connect layer on the server side t

Re: [GENERAL] DB alias ?

2013-01-23 Thread Steve Crawford
On 01/23/2013 02:08 PM, Gauthier, Dave wrote: For each phase of a project, a new DB is created But in the meantime, I have to redirect them to P2_DB without changing anything in the linux environment. I need to have the DB itself "know" that the dbname "P3_DB" really = "P2_DB" for the time

Re: [GENERAL] DB alias ?

2013-01-23 Thread Andrew Sullivan
On Wed, Jan 23, 2013 at 10:08:05PM +, Gauthier, Dave wrote: > For each phase of a project, a new DB is created. The project phase is > identified in a linux environment variable (lets call it $PHASE). The DB > name that is used in the connect string of the perl/DBI scripts they run is > de

Re: [GENERAL] DB alias ?

2013-01-23 Thread Gauthier, Dave
ginal Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Steve Crawford Sent: Wednesday, January 23, 2013 4:38 PM To: Rob Sargent Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] DB alias ? On 01/23/2013 01:16 PM, Rob Sargent wrote: > O

Re: [GENERAL] DB alias ?

2013-01-23 Thread Gauthier, Dave
On Behalf Of Rob Sargent Sent: Wednesday, January 23, 2013 4:16 PM To: pgsql-general@postgresql.org Subject: Re: [GENERAL] DB alias ? On 01/23/2013 02:10 PM, Gauthier, Dave wrote: > Nope. Think of it this way, a new DB is created on day 1 of every month. So > there's a DB called

Re: [GENERAL] DB alias ?

2013-01-23 Thread Steve Crawford
On 01/23/2013 01:16 PM, Rob Sargent wrote: On 01/23/2013 02:10 PM, Gauthier, Dave wrote: Nope. Think of it this way, a new DB is created on day 1 of every month. So there's a DB called JAN, another called FEB, etc... . The DB name used in the connect is picked up from the current date/time.

Re: [GENERAL] DB alias ?

2013-01-23 Thread John R Pierce
On 1/23/2013 1:10 PM, Gauthier, Dave wrote: Nope. Think of it this way, a new DB is created on day 1 of every month. So there's a DB called JAN, another called FEB, etc... . The DB name used in the connect is picked up from the current date/time. But January is oevr and I don't want to cre

Re: [GENERAL] DB alias ?

2013-01-23 Thread Rob Sargent
gresql.org Subject: Re: [GENERAL] DB alias ? On 01/23/2013 12:45 PM, Gauthier, Dave wrote: Problem: Some users (scripts actually) try to connect to a DB who's name is derived from environmental variables. The DB doesn't exist (yet), and I want them to connect to a different DB fo

Re: [GENERAL] DB alias ?

2013-01-23 Thread Gauthier, Dave
h. In the meantime, I want those who try to connect to FEB to connect to JAN (for example). -Original Message- From: Joshua D. Drake [mailto:j...@commandprompt.com] Sent: Wednesday, January 23, 2013 4:04 PM To: Gauthier, Dave Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] DB alias ?

Re: [GENERAL] DB alias ?

2013-01-23 Thread Joshua D. Drake
On 01/23/2013 12:45 PM, Gauthier, Dave wrote: Problem: Some users (scripts actually) try to connect to a DB who's name is derived from environmental variables. The DB doesn't exist (yet), and I want them to connect to a different DB for the time being. Is there a way to define an alias for the

Re: [GENERAL] DB alias ?

2013-01-23 Thread Alvaro Herrera
Gauthier, Dave wrote: > Problem: Some users (scripts actually) try to connect to a DB who's name is > derived from environmental variables. The DB doesn't exist (yet), and I want > them to connect to a different DB for the time being. Is there a way to > define an alias for the existing DB th

[GENERAL] DB alias ?

2013-01-23 Thread Gauthier, Dave
Problem: Some users (scripts actually) try to connect to a DB who's name is derived from environmental variables. The DB doesn't exist (yet), and I want them to connect to a different DB for the time being. Is there a way to define an alias for the existing DB that = the db name that doesn't

Re: [GENERAL] db alias

2012-06-06 Thread Albe Laurenz
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

Re: [GENERAL] db alias

2012-06-05 Thread Guillaume Lelarge
On Tue, 2012-06-05 at 18:59 +, 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 user

[GENERAL] db alias

2012-06-05 Thread Gauthier, Dave
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 D