pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marc Cousin <cousinmarc@gmail.com>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #5801: characters not encoded properly for column names
Date: Thu, 23 Dec 2010 11:34:47 +0100
Message-ID: <201012231134.47840.cousinmarc@gmail.com> (raw)
In-Reply-To: <AANLkTin9CoXtE3tQY+pdFwjz=OFLZbyp4fBBxy1Ng3k_@mail.gmail.com>
References: <201012231018.oBNAIfdF020454@wwwmaster.postgresql.org>
	<AANLkTin9CoXtE3tQY+pdFwjz=OFLZbyp4fBBxy1Ng3k_@mail.gmail.com>

No, from a Linux psql client (inside a kde konsole). You can setup any charset 
in it. I have exactly the same behaviour with psql under windows anyway, with 
a chcp 1252 in the cmd console. It's not a console charset problem, I've 
tripled checked that :)

And anyway, this character shouldn't get into the database as UTF8, as it is 
1252 (hence the error message).



The Thursday 23 December 2010 11:24:21, Pavel Stehule wrote :
> Hello Marc,
> 
> 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.
> 
> Regards
> 
> Pavel Stehule
> 
> 2010/12/23 Marc Cousin <cousinmarc@gmail.com>:
> > The following bug has been logged online:
> > 
> > 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:
> > 
> > I get a different behaviour between a Linux and a Windows server, when a
> > user creates an accentuated column name.
> > 
> > All tests below were done with a linux psql client, the console being set
> > on win1252 charset (so the input character is truly 'é' in win1252)
> > 
> > With the Linux server :
> > marc=# SET client_encoding TO 'win1252';
> > SET
> > marc=# CREATE TABLE test (nom varchar, prénom varchar);
> > CREATE TABLE
> > 
> > 
> > marc=# \d test
> > 
> > 
> >          Table "public.test"
> > 
> > 
> >  Column |       Type        | Modifiers
> > 
> > 
> > --------+-------------------+-----------
> > 
> > 
> >  nom    | character varying |
> > 
> > 
> >  prénom | character varying |
> > 
> > 'prénom' is also displayed correctly if client_encoding and console are
> > UTF8, so the conversion is good.
> > 
> > With the Windows server :
> > test=# SET client_encoding TO 'win1252';
> > SET
> > test=# CREATE TABLE test (nom varchar, prénom varchar);
> > CREATE TABLE
> > test=# \d test
> > ERROR:  invalid byte sequence for encoding "UTF8": 0xe3a96e
> > test=# SELECT attname from pg_attribute where attrelid = (select oid from
> > pg_class where relname = 'test');
> > ERROR:  invalid byte sequence for encoding "UTF8": 0xe3a96e
> > test=# select version();
> >                           version
> > -------------------------------------------------------------
> >  PostgreSQL 9.0.2, compiled by Visual C++ build 1500, 32-bit
> > (1 row)
> > 
> > 
> > The main reason that this is a problem is that the table cannot be
> > pg_dumped anymore because of this.
> > 
> > --
> > Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
> > To make changes to your subscription:
> > http://www.postgresql.org/mailpref/pgsql-bugs



view thread (9+ messages)  latest in thread

Message-ID: <201012231134.47840.cousinmarc@gmail.com>
Permalink:  ../201012231134.47840.cousinmarc@gmail.com/
Also on:    postgresql.org/message-id/201012231134.47840.cousinmarc@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: cousinmarc@gmail.com, pavel.stehule@gmail.com
  Subject: Re: BUG #5801: characters not encoded properly for column names
  In-Reply-To: <201012231134.47840.cousinmarc@gmail.com>
  References: <201012231018.oBNAIfdF020454@wwwmaster.postgresql.org> <AANLkTin9CoXtE3tQY+pdFwjz=OFLZbyp4fBBxy1Ng3k_@mail.gmail.com> <201012231134.47840.cousinmarc@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox