Re: PQclientEncoding() returns -1, resulting in possible assertion failure in psql

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tatsuo Ishii <ishii(at)postgresql(dot)org>
Cc: tgl(at)sss(dot)pgh(dot)pa(dot)us, pg(at)heroku(dot)com, pgsql-bugs(at)postgresql(dot)org
Subject: Re: PQclientEncoding() returns -1, resulting in possible assertion failure in psql
Date: 2014-03-22 01:53:25
Message-ID: 20140322015325.GA21843@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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 <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message CS_DBA 2014-03-22 02:44:32 Configure errors
Previous Message Bruce Momjian 2014-03-21 22:10:15 Re: BUG #8354: stripped positions can generate nonzero rank in ts_rank_cd