Re: Determining client_encoding from client locale - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Determining client_encoding from client locale
Date
Msg-id 18850.1245287480@sss.pgh.pa.us
Whole thread Raw
In response to Re: Determining client_encoding from client locale  (Itagaki Takahiro <itagaki.takahiro@oss.ntt.co.jp>)
Responses Re: Determining client_encoding from client locale  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
Itagaki Takahiro <itagaki.takahiro@oss.ntt.co.jp> writes:
> Peter Eisentraut <peter_e@gmx.net> wrote:
>> On Wednesday 17 June 2009 14:29:26 Heikki Linnakangas wrote:
>>> We currently require that you set client_encoding correctly, or you get
>>> garbage in psql and any other tool using libpq. How about setting
>>> client_encoding automatically to match the client's locale? We have
>>> pg_get_encoding_from_locale() function that we can use to extract the
>>> encoding from LC_CTYPE. We could call that in libpq.

> +1 for psql, but -1 for libpq.

What would make sense to me is for libpq to provide the *code* for this,
but then leave it up to the client application whether to actually call
it; if not the behavior stays the same as before.  Aside from
Itagaki-san's objections, that eliminates backwards-compatibility issues
for other applications.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Itagaki Takahiro
Date:
Subject: Re: Determining client_encoding from client locale
Next
From: Robert Haas
Date:
Subject: generic explain options v3