Re: DB alias ?

From: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: DB alias ?
Date: 2013-01-23 22:17:59
Message-ID: 20130123221759.GN7727@crankycanuck.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 (lets call it $PHASE). The DB name that is used in the connect string of the perl/DBI scripts they run is derived from that in 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's a different discussion.)

Best,

A

--
Andrew Sullivan
ajs(at)crankycanuck(dot)ca

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Steve Crawford 2013-01-23 22:25:46 Re: DB alias ?
Previous Message Gauthier, Dave 2013-01-23 22:08:05 Re: DB alias ?