On Thu, Oct 27, 2016 at 2:01 AM, Tom Lane <t...@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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers