Re: DB alias ?

From: "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: DB alias ?
Date: 2013-01-23 21:10:13
Message-ID: 0AD01C53605506449BA127FB8B99E5E16112D04F@FMSMSX105.amr.corp.intel.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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 create the FEB DB until Feb 15th. 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:jd(at)commandprompt(dot)com]
Sent: Wednesday, January 23, 2013 4:04 PM
To: Gauthier, Dave
Cc: pgsql-general(at)postgresql(dot)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 for the time being.
> Is there a way to define an alias for the existing DB that = the db name
> that doesn't exist? Or is there a way to have PG fail over to a
> default DB should a DB connect fail? I can implement the fail over
> outside PG, but those users who make a direct connect to the DB don't
> use that code.

Pass the database name when you connect?

JD

>
> Thanks in Advance
>

--
Command Prompt, Inc. - http://www.commandprompt.com/ PostgreSQL Support, Training, Professional Services and Development High Availability, Oracle Conversion, Postgres-XC @cmdpromptinc - 509-416-6579

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rob Sargent 2013-01-23 21:16:20 Re: DB alias ?
Previous Message Joshua D. Drake 2013-01-23 21:04:19 Re: DB alias ?