Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 4305D634F79 for ; Mon, 24 Aug 2009 19:42:41 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 30778-09 for ; Mon, 24 Aug 2009 22:42:24 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mail.postgresql.org (Postfix) with SMTP id 932F9634D7E for ; Mon, 24 Aug 2009 19:42:29 -0300 (ADT) Received: (qmail invoked by alias); 24 Aug 2009 22:42:26 -0000 Received: from a91-154-107-53.elisa-laajakaista.fi (EHLO [10.0.0.101]) [91.154.107.53] by mail.gmx.net (mp036) with SMTP; 25 Aug 2009 00:42:26 +0200 X-Authenticated: #495269 X-Provags-ID: V01U2FsdGVkX18tbYBS2dwtyRgCaToPxp1/SFnvj/CftQ/FLoA1q0 IzL61gARJ5K36a Subject: Re: Question about encoding From: Peter Eisentraut To: Denis BUCHER Cc: pgsql-sql@postgresql.org In-Reply-To: <4A92C305.2020303@hsolutions.ch> References: <4A92C305.2020303@hsolutions.ch> Content-Type: text/plain; charset="UTF-8" Date: Tue, 25 Aug 2009 01:42:25 +0300 Message-Id: <1251153745.29824.19.camel@vanquo.pezone.net> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 Content-Transfer-Encoding: 8bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.62 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.567 tagged_above=-10 required=5 tests=AWL=0.032, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200908/125 X-Sequence-Number: 33034 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.