Re: Question about encoding

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Denis BUCHER <dbucherml(at)hsolutions(dot)ch>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Question about encoding
Date: 2009-08-24 22:42:25
Message-ID: 1251153745.29824.19.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On mån, 2009-08-24 at 18:42 +0200, Denis BUCHER wrote:
> Question 1 :
> Is it the expected behavior ? These characters have a SQL_ASCII
> equivalent because I already have them stored in another table of the
> same database

SQL_ASCII is not the same as ASCII. SQL_ASCII means, take the bytes as
they come. So a 40-character UTF-8 string might indeed be longer than
40 bytes, which is what SQL_ASCII will look at.

The best bet is to avoid SQL_ASCII altogether. It's pretty bogus and
inconsistent.

> Question 2 :
> If yes, then I suppose I should have the database as LATIN1 or UTF8.
> Can I change/convert the encoding of the database ? Or at least of the
> schema (which would be even better)

Dump, recreate database with right encoding, restore.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Denis BUCHER 2009-08-25 20:16:24 Re: Question about encoding
Previous Message Denis BUCHER 2009-08-24 16:42:45 Question about encoding