Re: Client Messages - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Client Messages
Date
Msg-id 4484.1327591916@sss.pgh.pa.us
Whole thread Raw
In response to Re: Client Messages  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: Client Messages  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
Heikki Linnakangas <heikki.linnakangas@enterprisedb.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


pgsql-hackers by date:

Previous
From: Abhijit Menon-Sen
Date:
Subject: Re: proposal: better support for debugging of overloaded functions
Next
From: Abhijit Menon-Sen
Date:
Subject: Re: PL/Python result metadata