On 01/23/2013 02:08 PM, Gauthier, Dave wrote:
> For each phase of a project, a new DB is created.... But in the meantime, I have to redirect them to P2_DB without
changinganything in the linux environment. I need to have the DB itself "know" that the dbname "P3_DB" really =
"P2_DB"for the time being. A simple mapping capability could do it.
>
> I'm googling around for the connection service stuff, but its really sparse. And its not clear where, in my linux
install,I'm supposed to find the config file. Even if I find it, I'll need a utility that the DBA can use to modify it
(Iwon't have direct access to it for manual edit or anything like that). But a service file concept sounds intriguing.
>
>
First, the convention on this mailing list is to bottom-post so people
can follow threads. Top-posting is frowned upon.
Given your expanded description I think you should look at pgBouncer.
Although it is intended as a connection pooler, the configuration allows
you to set a database name on the client-facing side that is different
than the actual name of the database the pooler connects to. So both
p2_db and p3_db could point to real_p2_db until you update the pgBouncer
config.
Depending on how you authenticate/authorize you may have to fuss with
some of the password settings and to minimize client-side changes you
will probably have to change PostgreSQL to listen on a different port
then have pgBouncer listen on the standard 5432 so things appear
unchanged to the clients.
As a bonus, the new databases can be on different machines if you choose.
http://pgfoundry.org/projects/pgbouncer/
Cheers,
Steve