From: | Steve Crawford <scrawford(at)pinpointresearch(dot)com> |
---|---|
To: | Rob Sargent <robjsargent(at)gmail(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: DB alias ? |
Date: | 2013-01-23 21:38:23 |
Message-ID: | 5100584F.8040102@pinpointresearch.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Gauthier, Dave | 2013-01-23 21:39:43 | Re: DB alias ? |
Previous Message | John R Pierce | 2013-01-23 21:23:56 | Re: DB alias ? |