Re: DB alias ? - Mailing list pgsql-general

From Andrew Sullivan
Subject Re: DB alias ?
Date
Msg-id 20130123221759.GN7727@crankycanuck.ca
Whole thread Raw
In response to Re: DB alias ?  ("Gauthier, Dave" <dave.gauthier@intel.com>)
List pgsql-general
On Wed, Jan 23, 2013 at 10:08:05PM +0000, Gauthier, Dave wrote:
> For each phase of a project, a new DB is created.  The project phase is identified in a linux environment variable
(letscall it $PHASE).  The DB name that is used in the connect string of the perl/DBI scripts they run is derived from
thatin the perl/DBI script, maybe something like this... $db = $ENV{PHASE}."_DB", followed by the db connect string.
  
>

It seems that this is your problem.  What you need to do is something more like

    $db = $ENV{PROJDB}."_DB" || $db = $ENV{PHASE}."_DB"

Then have (only) the people who are supposed to be working on the non-standard database name set PROJDB in their
environment,and your problem is solved.  No? 

(I have reservations about this entire thing anyway.  It feels to me you really want to be using schemas here, but
that'sa different discussion.) 

Best,

A

--
Andrew Sullivan
ajs@crankycanuck.ca


pgsql-general by date:

Previous
From: "Gauthier, Dave"
Date:
Subject: Re: DB alias ?
Next
From: Steve Crawford
Date:
Subject: Re: DB alias ?