Re: Client Messages

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Jim Mlodgenski <jimmy76(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Client Messages
Date: 2012-01-26 15:31:56
Message-ID: 4484.1327591916@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> writes:
> 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?

I've not looked at the patch, but what exactly will happen if the string
has the wrong encoding?

The idea that occurs to me is to have the code that uses the GUC do a
verify_mbstr(noerror) on it, and silently ignore it if it doesn't pass
(maybe with a LOG message). This would have to be documented of course,
but it seems better than the potential consequences of trying to send a
wrongly-encoded string.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Abhijit Menon-Sen 2012-01-26 15:47:17 Re: PL/Python result metadata
Previous Message Abhijit Menon-Sen 2012-01-26 15:28:12 Re: proposal: better support for debugging of overloaded functions