Re: Switching database inside current connection - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: Switching database inside current connection
Date
Msg-id Pine.BSO.4.63.0609272325480.2117@leary2.csoft.net
Whole thread Raw
In response to Switching database inside current connection  (Jeff Madison <jeff@madisonfam.net>)
List pgsql-jdbc

On Wed, 27 Sep 2006, Jeff Madison wrote:

> I have to search multiple, identical databases on a server and am currently
> having to create a DataSource for each database on the server and then get a
> connection.  How would I create a DataSource for the server and then modify
> the connnection to "switch" databases.  I would like to just re-use the same
> connection for obvious reasons.

This is not possible with postgresql.  You can only use the database you
initially connected to.  To access parts of other database you can use
contrib/dblink, but for your purposes I think multiple connections are
required.

Kris Jurka

pgsql-jdbc by date:

Previous
From: Jeff Madison
Date:
Subject: Switching database inside current connection
Next
From: Michael Paesold
Date:
Subject: Re: [pgsql-jdbc] dollar-quoted CREATE FUNCTION statement fails