Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 8C72B1337BCF for ; Thu, 23 Dec 2010 06:34:56 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 11483-02 for ; Thu, 23 Dec 2010 10:34:49 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mimolette.dalibo.net (unknown [212.85.154.222]) by mail.postgresql.org (Postfix) with ESMTP id 1D13E1337BCC for ; Thu, 23 Dec 2010 06:34:49 -0400 (AST) Received: from marco-dalibo.localnet (gev44-1-78-228-108-65.fbx.proxad.net [78.228.108.65]) by mimolette.dalibo.net (Postfix) with ESMTPSA id D1D00D815F; Thu, 23 Dec 2010 11:34:48 +0100 (CET) From: Marc Cousin To: Pavel Stehule Subject: Re: BUG #5801: characters not encoded properly for column names Date: Thu, 23 Dec 2010 11:34:47 +0100 User-Agent: KMail/1.13.5 (Linux/2.6.36-ARCH; KDE/4.5.4; x86_64; ; ) Cc: pgsql-bugs@postgresql.org References: <201012231018.oBNAIfdF020454@wwwmaster.postgresql.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <201012231134.47840.cousinmarc@gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.106 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RDNS_NONE=0.793 X-Spam-Level: X-Archive-Number: 201012/169 X-Sequence-Number: 28975 No, from a Linux psql client (inside a kde konsole). You can setup any char= set=20 in it. I have exactly the same behaviour with psql under windows anyway, wi= th=20 a chcp 1252 in the cmd console. It's not a console charset problem, I've=20 tripled checked that :) And anyway, this character shouldn't get into the database as UTF8, as it i= s=20 1252 (hence the error message). The Thursday 23 December 2010 11:24:21, Pavel Stehule wrote : > Hello Marc, >=20 > It was entered from a windows cmd console? It doesn't use win > encodings as default. For example, it must be executed with parameter > /c chcp 1250 for win1250 encoding. >=20 > Regards >=20 > Pavel Stehule >=20 > 2010/12/23 Marc Cousin : > > The following bug has been logged online: > >=20 > > Bug reference: 5801 > > Logged by: Marc Cousin > > Email address: cousinmarc@gmail.com > > PostgreSQL version: 9.0.2 > > Operating system: Windows XP > > Description: characters not encoded properly for column names > > Details: > >=20 > > I get a different behaviour between a Linux and a Windows server, when a > > user creates an accentuated column name. > >=20 > > All tests below were done with a linux psql client, the console being s= et > > on win1252 charset (so the input character is truly '=C3=A9' in win1252) > >=20 > > With the Linux server : > > marc=3D# SET client_encoding TO 'win1252'; > > SET > > marc=3D# CREATE TABLE test (nom varchar, pr=C3=A9nom varchar); > > CREATE TABLE > >=20 > >=20 > > marc=3D# \d test > >=20 > >=20 > > Table "public.test" > >=20 > >=20 > > Column | Type | Modifiers > >=20 > >=20 > > --------+-------------------+----------- > >=20 > >=20 > > nom | character varying | > >=20 > >=20 > > pr=C3=A9nom | character varying | > >=20 > > 'pr=C3=A9nom' is also displayed correctly if client_encoding and consol= e are > > UTF8, so the conversion is good. > >=20 > > With the Windows server : > > test=3D# SET client_encoding TO 'win1252'; > > SET > > test=3D# CREATE TABLE test (nom varchar, pr=C3=A9nom varchar); > > CREATE TABLE > > test=3D# \d test > > ERROR: invalid byte sequence for encoding "UTF8": 0xe3a96e > > test=3D# SELECT attname from pg_attribute where attrelid =3D (select oi= d from > > pg_class where relname =3D 'test'); > > ERROR: invalid byte sequence for encoding "UTF8": 0xe3a96e > > test=3D# select version(); > > version > > ------------------------------------------------------------- > > PostgreSQL 9.0.2, compiled by Visual C++ build 1500, 32-bit > > (1 row) > >=20 > >=20 > > The main reason that this is a problem is that the table cannot be > > pg_dumped anymore because of this. > >=20 > > -- > > Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) > > To make changes to your subscription: > > http://www.postgresql.org/mailpref/pgsql-bugs