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

From: Peter Geoghegan <pg(at)heroku(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: PQclientEncoding() returns -1, resulting in possible assertion failure in psql
Date: 2013-12-08 20:36:44
Message-ID: CAM3SWZSjgnAh2EZjpEf8ygTkvX7PtkEaxk7EvCOYWwqqmxPw5Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sun, Dec 8, 2013 at 10:56 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tatsuo Ishii 2013-12-08 23:17:35 Re: PQclientEncoding() returns -1, resulting in possible assertion failure in psql
Previous Message Tom Lane 2013-12-08 18:56:44 Re: PQclientEncoding() returns -1, resulting in possible assertion failure in psql