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