Re: Bug in UTF8-Validation Code?

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Mario Weilguni <mweilguni(at)sime(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Bug in UTF8-Validation Code?
Date: 2007-03-22 20:54:57
Message-ID: 200703222054.l2MKsvq08654@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Added to TODO:

* Fix cases where invalid byte encodings are accepted by the database,
but throw an error on SELECT

http://archives.postgresql.org/pgsql-hackers/2007-03/msg00767.php

Is anyone working on fixing this bug?

---------------------------------------------------------------------------

Mario Weilguni wrote:
> Hi,
>
> I've a problem with a database, I can dump the database to a file, but
> restoration fails, happens with 8.1.4.
>
> Steps to reproduce:
> create database testdb with encoding='UTF8';
> \c testdb
> create table test(x text);
> insert into test values ('\244'); ==> Is akzepted, even if not UTF8.
>
> pg_dump testdb -f testdb.dump -Fc
> pg_restore -f testdb.dump -d testdb => fails with an error:
> ERROR: invalid byte sequence for encoding "UTF8": 0xa4
>
> The problem itself comes from a CSV file, which is imported with \copy without
> proper quoting (so I have to fix this anyway), but I still think this is an
> error, making restoration very complicated in such cases...
>
> Or am I doing something completly wrong here?
>
> Best regards,
> Mario Weilguni
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2007-03-22 20:55:24 Re: [PATCHES] xpath_array with namespaces support
Previous Message Peter Eisentraut 2007-03-22 20:54:42 Re: xpath_array with namespaces support