Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 2C392B5DE06 for ; Tue, 6 Sep 2011 12:13:21 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 57840-01 for ; Tue, 6 Sep 2011 15:13:12 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from depesz.com (andy.depesz.com [88.198.47.100]) by mail.postgresql.org (Postfix) with ESMTP id 21E72B5DE15 for ; Tue, 6 Sep 2011 12:12:57 -0300 (ADT) Received: from andy.depesz.com ([88.198.47.100] helo=depesz.com) by depesz.com with esmtpa (Exim 4.76) (envelope-from ) id 1R0xKY-0000ho-BY; Tue, 06 Sep 2011 17:12:54 +0200 Date: Tue, 6 Sep 2011 17:12:54 +0200 From: hubert depesz lubaczewski To: Tom Lane Cc: pgsql-bugs@postgresql.org Subject: Re: psql doesn't reuse -p after backend fail Message-ID: <20110906151253.GA1209@depesz.com> Reply-To: depesz@depesz.com References: <20110905174633.GA7752@depesz.com> <11444.1315247243@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <11444.1315247243@sss.pgh.pa.us> User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.404 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201109/41 X-Sequence-Number: 31058 On Mon, Sep 05, 2011 at 02:27:23PM -0400, Tom Lane wrote: > It's not just the port, it's all the connection parameters --- > do_connect relies on the PGconn object to remember those, and in this > case there no longer is a PGconn object. > > We could have psql keep that information separately, but I'm not sure > it's really worth the trouble. well, I think it's definitely worth the trouble. If I had datbaase standing at 5432, it would connect to it, and then I could mistakenly ran commands to wrong database. this is clearly not a good thing. depesz -- The best thing about modern society is how easy it is to avoid contact with it. http://depesz.com/