Re: what to do about unsupported encodings - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: what to do about unsupported encodings
Date
Msg-id CAB7nPqS0LObthaH3U_aSNt0jtPd5x1XmALKJNw4H=R0s991KZA@mail.gmail.com
Whole thread Raw
In response to Re: what to do about unsupported encodings  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Thu, Oct 27, 2016 at 2:01 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Slightly related: there are some callers such as PGLC_localeconv that
> aren't checking for a failure return.  Seems bad.

And also related to the patch trying to improve OOM handling in
pg_locale.c, the point being that elog() cannot be called as long as
the saved locales are not put back in place. The cleanest fix here
would be to use a goto to take the code past restoring the saved
locales, and then issue and ERROR. I think that it would be better to
hit those two stones at once on the other thread.

For the calls in fe-connect.c, why are the calls of
pg_get_encoding_from_locale() requesting to print a message on error?
Shouldn't the caller request to *not* print an error instead and then
store an error string in conn->errorMessage if the encoding is < 0? It
seems to me that at the end the right call is to just remove
write_message all together and let the caller decide the error message
it wants. For HEAD that would be a fine cleanup to do. A patch does
not look that complicated, I could get one out according to those
lines.

Thoughts?
-- 
Michael



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [BUG] pg_basebackup from disconnected standby fails
Next
From: amul sul
Date:
Subject: Query regarding selectDumpableExtension()