Re: BUG #6246: character encoding for 64 bit

From: bushcraftrelf <cyclingrelf(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6246: character encoding for 64 bit
Date: 2011-10-14 10:59:10
Message-ID: 1318589950754-4902202.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

I think I've figured it out - thanks all for your help. Craig Ringer appears
to be right.

From documentation for psql 9.1 under Usage>Connecting to a database

"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."

This is not in 9.0 documentation, so I think is new? Anyway, that explains
the difference in behaviour between 9.0 and 9.1

So...I've altered runpsql.bat to include these lines at the beginning:

REM change terminal to UTF8
chcp 65001

and added an environment variable PGCLIENTENCODING=UTF8

Now I can connect to the LATIN1 database without any problems (postgres
automatically converts between UTF8 and LATIN1 - "Character set conversion
between server and client"
http://www.postgresql.org/docs/9.1/static/multibyte.html)

Please, does anyone know if I am likely to cause myself problems running the
terminal with the UTF8 codepage?

--
View this message in context: http://postgresql.1045698.n5.nabble.com/BUG-6246-character-encoding-for-64-bit-tp4888531p4902202.html
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Robert Haas 2011-10-14 15:15:44 Re: Tablespace files deleted in continuous run
Previous Message bushcraftrelf 2011-10-14 09:42:35 Re: BUG #6246: character encoding for 64 bit