Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WRB7t-00039Z-4I for pgsql-bugs@arkaria.postgresql.org; Sat, 22 Mar 2014 01:53:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WRB7s-0000vX-GU for pgsql-bugs@arkaria.postgresql.org; Sat, 22 Mar 2014 01:53:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WRB7q-0000vO-Go for pgsql-bugs@postgresql.org; Sat, 22 Mar 2014 01:53:30 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WRB7n-0001N9-CC; Sat, 22 Mar 2014 01:53:30 +0000 Received: from bruce by momjian.us with local (Exim 4.72) (envelope-from ) id 1WRB7l-0006L7-5R; Fri, 21 Mar 2014 21:53:25 -0400 Date: Fri, 21 Mar 2014 21:53:25 -0400 From: Bruce Momjian To: Tatsuo Ishii Cc: tgl@sss.pgh.pa.us, pg@heroku.com, pgsql-bugs@postgresql.org Subject: Re: PQclientEncoding() returns -1, resulting in possible assertion failure in psql Message-ID: <20140322015325.GA21843@momjian.us> References: <14465.1386526658@sss.pgh.pa.us> <15210.1386529004@sss.pgh.pa.us> <20131209.081735.1321847791044178990.t-ishii@sraoss.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131209.081735.1321847791044178990.t-ishii@sraoss.co.jp> User-Agent: Mutt/1.5.20 (2009-06-14) X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On Mon, Dec 9, 2013 at 08:17:35AM +0900, Tatsuo Ishii wrote: > > branches. I would argue however that the documentation nowhere > > suggests that PQclientEncoding can return a bogus encoding ID, > > so this is more likely to be a bug fix than a new bug for other > > programs as well. Also, it looks to me like there are probably > > This sounds like a little bit unfair argument. The libpq documentation > is pretty sloppy for the error case for other PQ* as well. For > example, look at the PQdb document: > > PQdb > Returns the database name of the connection. > char *PQdb(const PGconn *conn); > > This says nothing about when the connection is bad. Reality is PQdb > returns NULL in the case. But are we allowed to change PQdb returns > say, "template1" when the connection is bad because the doc says > nothing about error case? So, what did we decide on this? Should we document the -1 return, or return SQL_ASCII. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + Everyone has their own god. + -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs