Re: Client encoding not the same as the db encoding

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org, clodoaldo(dot)pinto(dot)neto(at)gmail(dot)com
Subject: Re: Client encoding not the same as the db encoding
Date: 2012-02-29 16:39:16
Message-ID: 4F4E54B4.1040107@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 02/29/2012 07:50 AM, Tom Lane wrote:
> Adrian Klaver<adrian(dot)klaver(at)gmail(dot)com> writes:
>> On Wednesday, February 29, 2012 6:47:21 am Clodoaldo Neto wrote:
>>> In 9.1.3 the client encoding is not defaulting to the db encoding:
>>> What am i missing? Regards, Clodoaldo
>
>> My guess this:
>> http://www.postgresql.org/docs/9.1/interactive/release-9-1.html
>> "E.4.3.10.1. libpq
>
>> Add a libpq connection option client_encoding which behaves like
>> he PGCLIENTENCODING environment variable (Heikki Linnakangas)
>> The value auto sets the client encoding based on the operating
>> system locale.
>> "
>
> No, probably more this (under "psql")

Well I was half way there:)
http://www.postgresql.org/docs/9.1/interactive/app-psql.html

"If at least one of standard input or standard output are a terminal,
then psql sets the client encoding to "auto", which will detect the
appropriate client encoding from the locale settings (LC_CTYPE
environment variable on Unix systems). If this doesn't work out as
expected, the client encoding can be overridden using the environment
variable PGCLIENTENCODING."

>
> * Have psql set the client encoding from the operating system locale by default (Heikki Linnakangas)
>
> This only happens if the PGCLIENTENCODING environment variable is not set.
>
> I think the idea was to try to match your terminal window's encoding
> automatically.
>
> regards, tom lane

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message chinnaobi 2012-02-29 16:40:18 Re: archive_cleanup_command recovery.conf Standby server error
Previous Message akp geek 2012-02-29 16:32:27 Re: version controlling postgresql code