Re: PQclientEncoding() returns -1, resulting in possible assertion failure in psql - Mailing list pgsql-bugs

From Peter Geoghegan
Subject Re: PQclientEncoding() returns -1, resulting in possible assertion failure in psql
Date
Msg-id CAM3SWZSjgnAh2EZjpEf8ygTkvX7PtkEaxk7EvCOYWwqqmxPw5Q@mail.gmail.com
Whole thread Raw
In response to Re: PQclientEncoding() returns -1, resulting in possible assertion failure in psql  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On Sun, Dec 8, 2013 at 10:56 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I looked at this a bit more closely and it seems to be a legitimate
> fix.  I would also suggest that we remove the connection status check;
> there is no very good reason to forget what we knew about the encoding
> the moment the connection drops.

+1 to the idea of teaching PQclientEncoding() to report the last
encodingid, or returning PG_SQL_ASCII when that isn't possible. I was
previously a little unsure about that, simply because that behavior
has existed for many years, but as you say nobody has any right to
rely on it. I'm inclined to agree that it will help more than it will
hurt everyone else.


--
Peter Geoghegan

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: PQclientEncoding() returns -1, resulting in possible assertion failure in psql
Next
From: Tatsuo Ishii
Date:
Subject: Re: PQclientEncoding() returns -1, resulting in possible assertion failure in psql