Re: DB alias ? - Mailing list pgsql-general

From Steve Crawford
Subject Re: DB alias ?
Date
Msg-id 5100584F.8040102@pinpointresearch.com
Whole thread Raw
In response to Re: DB alias ?  (Rob Sargent <robjsargent@gmail.com>)
Responses Re: DB alias ?
List pgsql-general
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.
>> 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).
Perhaps it would be better if you more fully explained the problem you
are trying to solve (i.e. is it updated data but identical schemas, are
you replacing the old or are you keeping the old, etc.). Assuming you
have some flexibility in how you solve your actual issue, there are some
options.

1. Use pgBouncer so that all users connect to the pooler - perhaps using
a standard database like "current" and update the real database to which
that connects when it is ready.

2. Use schemas in a database instead of separate databases and update
the role information to set the search path to point to the appropriate
schema. Perhaps always call the most recent schema "current" then rename
schemas as/when needed.

3. Use a connection service file
http://www.postgresql.org/docs/current/static/libpq-pgservice.html that
is pushed/pulled/shared somehow with updated connection information.

Cheers,
Steve


pgsql-general by date:

Previous
From: John R Pierce
Date:
Subject: Re: DB alias ?
Next
From: "Gauthier, Dave"
Date:
Subject: Re: DB alias ?