Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 9020E633B92 for ; Mon, 22 Mar 2010 19:05:56 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 56080-02 for ; Mon, 22 Mar 2010 22:05:45 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-gy0-f174.google.com (mail-gy0-f174.google.com [209.85.160.174]) by mail.postgresql.org (Postfix) with ESMTP id 29B4F63297D for ; Mon, 22 Mar 2010 19:05:45 -0300 (ADT) Received: by gyg8 with SMTP id 8so2880561gyg.19 for ; Mon, 22 Mar 2010 15:05:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Y6AlmrkeMiA50kO3znjXZgVjX9BW2rnxZsJ18cHAUyo=; b=VmoeEeWDPEMQf6CE4YnDJC4wDvnFWsZxkj5zUEs1XbYXt/3FEFdze7M/xD3vbJTE8f C2UavsuknavV19BXz9+g8SWTjESWcpiDWaasWceH1ILGNU2L3QlvIzXKLzjJaUZiQp4l CosoWBYYKWL6/TbMkb759Pmoc25qJqDsSBuIQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=NSF6xUAOfGN+N8pU1u0BY8S4CbAswm1Kaun9nWzLJizHRlqkS2vV+bd6JrLlfIUwWk /Ng+5LiRRXbDOXQTENVxsgV/GQuCQBunrBuOFORIYsAqChtDjnax/zUle/MPCu2nBRei Wa80H4s+pE4hNT0HJK3cuKOkFckhqdgRoxits= MIME-Version: 1.0 Received: by 10.150.1.8 with SMTP id 8mr4701078yba.298.1269295544639; Mon, 22 Mar 2010 15:05:44 -0700 (PDT) In-Reply-To: <050f01cac99c$7dafe100$790fa300$@com> References: <050f01cac99c$7dafe100$790fa300$@com> Date: Mon, 22 Mar 2010 16:05:44 -0600 Message-ID: Subject: Re: Bad encoded chars in being inserted into database From: Scott Marlowe To: =?ISO-8859-1?Q?I=F1igo_Martinez_Lasala?= Cc: pgsql-admin@postgresql.org Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201003/156 X-Sequence-Number: 33955 On Mon, Mar 22, 2010 at 2:48 AM, I=F1igo Martinez Lasala wrote: > Hi everybody. > > > > I have a doubt about how postgres deal with bad encoded characters into > database. > > We have several gforge application. They are using postgres as database. > > If we export a database and import again, we have to deal with several ba= d > encoded chars. These bad chars always come from copy & paste emails from > Lotus Notes mail client. OK, I understand the Notes client people is usin= g > is an ancient application and does not deal very well with some Unicode > chars=85 > > What I cannot understand is why postgres accept these bad enconded > characters into database, exports them without problema but does not allo= w > them when importing again. > > This has been happening since postgers 7.3. However, until 7.4.XX (y don= =92t > remember what minor version) you could import database without ERRORs. > However, since 7.4.XX it=92s impossible and it=92s imperative to clean ba= d > characters (using iconv, for example) prior importing tables. This is because postgresql's support for UTF-8 encoding (and all encoding really) has gotten tighter over time, so that the filter to catch improperly encoded UTF has gotten better with each major release.