Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 651779FB1BC for ; Thu, 28 Sep 2006 11:34:05 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 67919-03 for ; Thu, 28 Sep 2006 11:34:00 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from exchange.g2switchworks.com (mail.g2switchworks.com [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id 095AD9FAE4E for ; Thu, 28 Sep 2006 11:33:59 -0300 (ADT) Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; Thu, 28 Sep 2006 14:33:52 +0000 Received: from state.g2switchworks.com by mail.g2switchworks.com; 28 Sep 2006 09:33:51 -0500 Subject: Re: Switching database inside current connection From: Scott Marlowe To: Jeff Madison Cc: pgsql-jdbc@postgresql.org In-Reply-To: <451B4CCE.7000105@madisonfam.net> References: <451B4CCE.7000105@madisonfam.net> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1159454031.26848.117.camel@state.g2switchworks.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Thu, 28 Sep 2006 09:33:51 -0500 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.079 tagged_above=0 required=5 tests=AWL, SPF_PASS, UNPARSEABLE_RELAY X-Spam-Level: X-Archive-Number: 200609/138 X-Sequence-Number: 15856 On Wed, 2006-09-27 at 23:17, 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. > > I'm running server version 7.3 and the coinciding JDBC driver version. If you can move away from individual databases to multiple schemas in one database, then your problem would be solved. Schema support was initially added in 7.3, but the tools needed for examining schemas and such were not quite done all the way back then. Upgrading to 7.4 at least makes dealing with schemas a little easier, and if you're upgrading to 7.4, might as well go all the way and get 8.1.4. 7.3 is on the very tail end of what's considered "supported".