From: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
To: Jim Mlodgenski <jimmy76@gmail.com>
Cc: Fujii Masao <masao.fujii@gmail.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Client Messages
Date: Thu, 26 Jan 2012 10:34:50 +0200
Message-ID: <4F21102A.2080506@enterprisedb.com> (raw)
In-Reply-To: <CAB_5SRc3LX3hhN3Qm380VaGkq_Eh8xRz+nriPf1va51uYAQH7w@mail.gmail.com>
References: <CAB_5SRdN1_rx0vkoZ8tC9PmcXCiy0QFEs_=vscg-UrFHeJdB=w@mail.gmail.com>
<CAHGQGwHM=U+Z_4ezO_tcW9bukBV2bdHg0ve3zMExhqZyX3h8ng@mail.gmail.com>
<4F167E08.9030802@enterprisedb.com>
<CAB_5SRefrOd4CM8m=snDicCUDU1QAqt2f+3SfT9eV+wPGWS_6A@mail.gmail.com>
<CAB_5SRd8xxWn5wAJ6iMoQqJQ1Wfqkbeh8Rhex+T8Uc1tHqSqfw@mail.gmail.com>
<4F1EA62C.8010203@enterprisedb.com>
<CAB_5SRc3LX3hhN3Qm380VaGkq_Eh8xRz+nriPf1va51uYAQH7w@mail.gmail.com>
On 25.01.2012 15:29, Jim Mlodgenski wrote:
> On Tue, Jan 24, 2012 at 7:38 AM, Heikki Linnakangas
> <heikki.linnakangas@enterprisedb.com> wrote:
>> There's one little problem remaining with this, which is what to do if the
>> message is in a different encoding than used by the client? That's not a new
>> problem, we have the same problem with any string GUC, if you do "SHOW
>> <setting>". We restricted application_name to ASCII characters, which is an
>> obvious way to avoid the problem, but I think it would be a shame to
>> restrict this to ASCII-only.
> Isn't that an issue for the administrator understanding his audience.
> Maybe some additional documentation explaining the encoding issue?
The thing is, there's currently no encoding conversion happening, so if
you have one database in LATIN1 encoding and another in UTF-8, for
example, whatever you put in your postgresql.conf is going to be wrong
for one database. I'm happy to just document the issue for per-database
messages, "ALTER DATABASE ... SET welcome_message", the encoding used
there need to match the encoding of the database, or it's displayed as
garbage. But what about per-user messages, when the user has access to
several databases, or postgresql.conf?
For postgresql.conf I think we could make a rule that it's always in
UTF-8. We haven't had to take a stance on the encoding used in
postgresql.conf before, but IMHO UTF-8 only would be quite reasonable.
We already have a problem there if for example you have two database
with different encodings, a schema with non-ascii characters in it, and
you try to put that schema in search_path in postgresql.conf. That's
such a rare situation that we haven't heard any complaints, but it's not
so unreasonable for welcome_message.
That still leaves the problem with per-user messages, though. We've
managed to dodge the encoding issue in shared catalogs this far. It
would be pretty hard to enforce any given encoding there, I think.
Perhaps we could just document that, and advice to create per-database
and per-user settings in that case.
--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: heikki.linnakangas@enterprisedb.com, jimmy76@gmail.com, masao.fujii@gmail.com
Subject: Re: Client Messages
In-Reply-To: <4F21102A.2080506@enterprisedb.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox