Re: BUG #2685: Wrong charset of server messages on client [PATCH] - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #2685: Wrong charset of server messages on client [PATCH]
Date
Msg-id 16461.1160494634@sss.pgh.pa.us
Whole thread Raw
In response to BUG #2685: Wrong charset of server messages on client [PATCH]  ("Sergiy Vyshnevetskiy" <serg@vostok.net>)
Responses Re: BUG #2685: Wrong charset of server messages on client  (Sergiy Vyshnevetskiy <serg@vostok.net>)
List pgsql-bugs
"Sergiy Vyshnevetskiy" <serg@vostok.net> writes:
> Convert server messages to database charset.

This has been discussed before:
http://archives.postgresql.org/pgsql-patches/2005-08/msg00245.php

The magic pg_enc2iananame_tbl[] you reference in your patch does not exist,
and if it did exist it wouldn't work on all platforms, since encoding
names aren't sufficiently well standardized :-(

> This, however, uncovers another bug: PostgreSQL dumps the messages into
> stderr/syslog as-is, without converting database data from database charset
> to charset from LC_MESSAGES.

I'm quite unconvinced that that's a bug.  If we tried to do a conversion
here, it would be trivial to set up denials of service for logging ---
just include a character in a comment in your SQL command that cannot be
converted to the LC_MESSAGES character set.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Milen A. Radev"
Date:
Subject: Re: BUG #2684: Memory leak in libpq
Next
From: Tom Lane
Date:
Subject: Re: BUG #2684: Memory leak in libpq