Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UA3Li-0003C7-Vf for pgsql-admin@arkaria.postgresql.org; Mon, 25 Feb 2013 19:04:31 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UA3Lh-0004g5-Gl for pgsql-admin@arkaria.postgresql.org; Mon, 25 Feb 2013 19:04:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UA3LZ-0004Ze-3Y; Mon, 25 Feb 2013 19:04:21 +0000 Received: from mail-da0-f47.google.com ([209.85.210.47]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UA3LW-0000Vh-9S; Mon, 25 Feb 2013 19:04:20 +0000 Received: by mail-da0-f47.google.com with SMTP id s35so1606103dak.20 for ; Mon, 25 Feb 2013 11:04:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=VgC0zuQlMXnPTeS6wUePqJITJATclUaxDnoxv4RyO9w=; b=oBcNVtaa4VsOTbdNQsN9OGmbg4GQuWsHwlgMP9f6ovjsR4lPGIMt8tYiyFZwiyjFmg 84F8Y00rnTo70GG1h3ou6u6DCzlOxcjs1F/Zj+e+jdV2cY5BHVQ90Yje83x7I9JtORdU AJj9Gv8Fh/BpSIudNTRgrOVlYXZJOb7MwKvGK8h+/mSAAzg6CuX8zpHXAife2rId/DPK tiltL1M+p/DKPUQI5C6zEo3PkPyp35bzd+nM+biI6IfgeGhNf/LfwwT913n6CdtJYYe2 uFujZdM0XLfzBOROdoapQZdz9oQWHUUnuCxQ1AT39xinzPBEaSiCcKAtFzgWCKWLzj2s uwhA== X-Received: by 10.68.191.229 with SMTP id hb5mr19733999pbc.201.1361819056081; Mon, 25 Feb 2013 11:04:16 -0800 (PST) Received: from [192.168.0.153] (c-24-17-179-185.hsd1.wa.comcast.net. [24.17.179.185]) by mx.google.com with ESMTPS id pg6sm13579245pbb.0.2013.02.25.11.04.14 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 Feb 2013 11:04:14 -0800 (PST) Message-ID: <512BB5AD.3080505@gmail.com> Date: Mon, 25 Feb 2013 11:04:13 -0800 From: Adrian Klaver User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130215 Thunderbird/17.0.3 MIME-Version: 1.0 To: Frank Cavaliero CC: pgsql-admin@postgresql.org, pgsql-general@postgresql.org Subject: Re: [GENERAL] Use, Set Catalog and JDBC questions References: <512BAE9A.2000401@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org On 02/25/2013 10:57 AM, Frank Cavaliero wrote: > Hi Adrian, > > Thanks for the response. The situation is more like the following: > > Using the JDBC driver, I connect to database TEST1 and immediately, > without having to pass username credentials again, I want to use > database TEST2. In MySQL, you can simply run: use TEST2. Wondering > if PostgreSQL has something similar. You can do it in the psql client like this, though that will not help with JDBC: aklaver@ford:~$ psql -d test -U postgres psql (9.0.5) Type "help" for help. test=# \c production You are now connected to database "production". production=# I do not use the JDBC driver much, but from what I read in the link I sent you, you can set up a non-pooling DataSource to which you can add predefined datasources and then switch as needed. > > Thanks, > Frank > -- Adrian Klaver adrian.klaver@gmail.com -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin