Thread: How to add conversion between LATIN1 and WIN1251?
Hello, early postgresql versions (< 9.1) did not show this error message: FATAL conversion between LATIN1 and WIN1251 is not supported and connect to db. I access server over the network and every time when I try to login because I work on latin1 I should export LANG="ru_RU.CP1251" for example. With few terminals on few different databases that is pretty disgustingly. Any way how I can avoid it ? -- Regards, Condor
On Friday, November 25, 2011 1:19:29 am Condor wrote: > Hello, > early postgresql versions (< 9.1) did not show this error message: > FATAL conversion between LATIN1 and WIN1251 is not supported > and connect to db. I access server over the network and every time when > I try to login because I work on latin1 I should export > LANG="ru_RU.CP1251" > for example. With few terminals on few different databases that is > pretty disgustingly. > Any way how I can avoid it ? Did the 9.1 database get created with a different character set then on previous versions? See here for automatic conversions: http://www.postgresql.org/docs/9.1/interactive/multibyte.html#AEN32070 Going back to 8.3 at least I do not see that it has changed. Going to release notes: http://www.postgresql.org/docs/9.1/interactive/release-9-1.html I see: " 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. " This led me to: http://www.postgresql.org/docs/9.1/interactive/runtime-config- client.html#RUNTIME-CONFIG-CLIENT-FORMAT " client_encoding (string) Sets the client-side encoding (character set). The default is to use the database encoding. The character sets supported by the PostgreSQL server are described in Section 22.3.1. " -- Adrian Klaver adrian.klaver@gmail.com
On 26.11.2011 00:42, Adrian Klaver wrote: > On Friday, November 25, 2011 1:19:29 am Condor wrote: >> Hello, >> early postgresql versions (< 9.1) did not show this error message: >> FATAL conversion between LATIN1 and WIN1251 is not supported >> and connect to db. I access server over the network and every time >> when >> I try to login because I work on latin1 I should export >> LANG="ru_RU.CP1251" >> for example. With few terminals on few different databases that is >> pretty disgustingly. >> Any way how I can avoid it ? > > Did the 9.1 database get created with a different character set then > on previous > versions? > > See here for automatic conversions: > > http://www.postgresql.org/docs/9.1/interactive/multibyte.html#AEN32070 > > Going back to 8.3 at least I do not see that it has changed. > > Going to release notes: > http://www.postgresql.org/docs/9.1/interactive/release-9-1.html > > I see: > " > 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. > " > This led me to: > http://www.postgresql.org/docs/9.1/interactive/runtime-config- > client.html#RUNTIME-CONFIG-CLIENT-FORMAT > " > client_encoding (string) > > Sets the client-side encoding (character set). The default is to > use the > database encoding. The character sets supported by the PostgreSQL > server are > described in Section 22.3.1. > " > > > -- > Adrian Klaver > adrian.klaver@gmail.com No, charset of databases is the same. I use the same ENV when I upgrade sql servers and recreate psql database directory. About client encoding, I never ever has before a configured postgresql on my work station where I connect to servers. Even postgres user and config file did not exists and this worked fine in psql versions below 9.1 -- Regards, Condor
On Friday, November 25, 2011 11:28:06 pm Condor wrote: > > No, charset of databases is the same. I use the same ENV when I upgrade > sql servers > and recreate psql database directory. > > About client encoding, I never ever has before a configured postgresql > on my work station > where I connect to servers. Even postgres user and config file did not > exists and this > worked fine in psql versions below 9.1 That is why I included a link to the Release Notes. There has been a change in behavior in 9.1. I am assuming that you are using psql to connect. If you want the details here is the commit: http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=02e14562a806a96f38120c96421d39dfa7394192 -- Adrian Klaver adrian.klaver@gmail.com
On 26.11.2011 22:33, Adrian Klaver wrote: > On Friday, November 25, 2011 11:28:06 pm Condor wrote: > >> >> No, charset of databases is the same. I use the same ENV when I >> upgrade >> sql servers >> and recreate psql database directory. >> >> About client encoding, I never ever has before a configured >> postgresql >> on my work station >> where I connect to servers. Even postgres user and config file did >> not >> exists and this >> worked fine in psql versions below 9.1 > > That is why I included a link to the Release Notes. There has been a > change in behavior in 9.1. > I am assuming that you are using psql to connect. > > If you want the details here is the commit: > > http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=02e14562a806a96f38120c96421d39dfa7394192 > > -- > Adrian Klaver > adrian.klaver@gmail.com Sorry, my bad. I read it now. -- Regards, Condor