Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UA2nj-0007ED-6q for pgsql-general@arkaria.postgresql.org; Mon, 25 Feb 2013 18:29:23 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UA2ni-0007GS-9g for pgsql-general@arkaria.postgresql.org; Mon, 25 Feb 2013 18:29:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UA2ng-0007FE-Ib for pgsql-general@postgresql.org; Mon, 25 Feb 2013 18:29:20 +0000 Received: from hogranch.com ([75.101.82.47]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UA2nd-0008N1-B1 for pgsql-general@postgresql.org; Mon, 25 Feb 2013 18:29:20 +0000 Received: from [192.168.0.2] (porker [192.168.0.2]) by hogranch.com (8.11.6/8.11.6) with ESMTP id r1PIT7921835 for ; Mon, 25 Feb 2013 10:29:07 -0800 Message-ID: <512BAD6F.6020800@hogranch.com> Date: Mon, 25 Feb 2013 10:29:03 -0800 From: John R Pierce User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20130215 Thunderbird/17.0.3 MIME-Version: 1.0 To: pgsql-general@postgresql.org Subject: Re: Use, Set Catalog and JDBC questions References: In-Reply-To: Content-Type: multipart/alternative; boundary="------------060701090806040903090209" X-HawgScanner-Information: Please contact the ISP for more information X-HawgScanner: Found to be clean X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org This is a multi-part message in MIME format. --------------060701090806040903090209 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 2/25/2013 10:22 AM, Frank Cavaliero wrote: > 1. Is there a USE DATABASE command or something of the sort (similar > to MySQL) that allows you to quickly connect to a database without > having to reconnect using the username,password and database again ? > In Java, we are using set catalog to do this in MySQL. no, there isn't. you have to connect to the database. mysql's databases are in many ways equivalent to postgres' 'schemas' within a single database (you can move between schemas with SET SEARCH_PATH=...). -- john r pierce 37N 122W somewhere on the middle of the left coast --------------060701090806040903090209 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
On 2/25/2013 10:22 AM, Frank Cavaliero wrote:
1.  Is there a USE DATABASE command or something of the sort (similar to MySQL) that allows you to quickly connect to a database without having to reconnect using the username,password and database again ?   In Java, we are using set catalog to do this in MySQL.

no, there isn't.    you have to connect to the database.     mysql's databases are in many ways equivalent to postgres'  'schemas' within a single database (you can move between schemas with SET SEARCH_PATH=...).

-- 
john r pierce                                      37N 122W
somewhere on the middle of the left coast
--------------060701090806040903090209--