pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Cc: 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:31:56 -0500
Message-ID: <4484.1327591916@sss.pgh.pa.us> (raw)
In-Reply-To: <4F21102A.2080506@enterprisedb.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>
	<4F21102A.2080506@enterprisedb.com>

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



view thread (16+ messages)  latest in thread

Message-ID: <4484.1327591916@sss.pgh.pa.us>
Permalink:  ../4484.1327591916@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/4484.1327591916@sss.pgh.pa.us

 · 

reply

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: tgl@sss.pgh.pa.us, heikki.linnakangas@enterprisedb.com, jimmy76@gmail.com, masao.fujii@gmail.com
  Subject: Re: Client Messages
  In-Reply-To: <4484.1327591916@sss.pgh.pa.us>

* 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