Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id A1AA2B5DBCE for ; Mon, 5 Sep 2011 15:28:30 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 35382-01 for ; Mon, 5 Sep 2011 18:28:24 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 47D48B5DBCB for ; Mon, 5 Sep 2011 15:28:24 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p85IRN9o011445; Mon, 5 Sep 2011 14:27:23 -0400 (EDT) To: depesz@depesz.com cc: pgsql-bugs@postgresql.org Subject: Re: psql doesn't reuse -p after backend fail In-reply-to: <20110905174633.GA7752@depesz.com> References: <20110905174633.GA7752@depesz.com> Comments: In-reply-to hubert depesz lubaczewski message dated "Mon, 05 Sep 2011 19:46:33 +0200" Date: Mon, 05 Sep 2011 14:27:23 -0400 Message-ID: <11444.1315247243@sss.pgh.pa.us> From: Tom Lane 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/33 X-Sequence-Number: 31050 hubert depesz lubaczewski writes: > ran psql with specyfying port: > psql -p 4329 -U postgres -d some_database > then I run query which breaks backend: > =# select * from categories limit 1; > The connection to the server was lost. Attempting reset: Failed. > !> > When I'll try to re-issue \c some_database now, I got: > !> \c some_database > could not connect to server: No such file or directory > Is the server running locally and accepting > connections on Unix domain socket "/tmp/.s.PGSQL.5432"? > !> 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. regards, tom lane