PostgreSQL8.1 “client encoding mismatch” with ODBC
While connecting to PostgreSQL using UnixODBC (from R, but this doesn’t matter) I got the following error:
[unixODBC]client encoding mismatch
It seems that there is some problem with PostgreSQL 8.1 and the encoding names: see this post or google. It looks that UTF8 used by default with the new Postgres is not compatible with old ODBC drivers. I am not sure where the problem really is, but a quick fix is to change default encoding for the user connecting to the database:
alter user <user> SET client_encoding to LATIN1;
February 2nd, 2007 at 11:14 am
Thanks .v.much. You saved me much hassle. You do not happen to know what is the def of old driver ?
Cheers
Phil
February 2nd, 2007 at 11:38 am
I think I discussed it here: http://tadek.pietraszek.org/blog/2005/09/22/configuring-postgresql-odbc-connector/
August 23rd, 2007 at 4:00 pm
loco me sircvio mucho gracias
August 4th, 2008 at 6:48 am
Woww… thanks dud,,,, your post was USEFULL.. my user client_encoding was changed to SQL_ASCII, and “client encoding mismatch” error message just disappear
Thank you sooo much,…
March 25th, 2009 at 7:04 am
Thank you! Problem solved!
November 25th, 2009 at 3:16 pm
me sirvió para conectarme desde el excel 2007 al postresql 8.4 en windows.. Gracias
April 27th, 2010 at 9:34 am
Thanks for this, most helpful. Love tech blogs that google links to my problems
Muchas Gracias!