Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 5A3DD9FB27F for ; Thu, 28 Sep 2006 01:28:03 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 01033-01 for ; Thu, 28 Sep 2006 04:27:59 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail63.csoft.net (mail63.csoft.net [205.205.214.4]) by postgresql.org (Postfix) with SMTP id 8CBAC9FB278 for ; Thu, 28 Sep 2006 01:27:58 -0300 (ADT) Received: (qmail 16195 invoked by uid 1112); 28 Sep 2006 04:27:57 -0000 Date: Wed, 27 Sep 2006 23:27:57 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary2.csoft.net To: Jeff Madison cc: pgsql-jdbc@postgresql.org Subject: Re: Switching database inside current connection In-Reply-To: <451B4CCE.7000105@madisonfam.net> Message-ID: References: <451B4CCE.7000105@madisonfam.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200609/135 X-Sequence-Number: 15853 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