Re: COPY fails on 8.1 with invalid byte sequences in text - Mailing list pgsql-bugs

From Dennis Bjorklund
Subject Re: COPY fails on 8.1 with invalid byte sequences in text
Date
Msg-id 454B8AA5.60608@zigo.dhs.org
Whole thread Raw
In response to Re: COPY fails on 8.1 with invalid byte sequences in text  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Tom Lane skrev:

>> Is this not a bug?
>
> I don't actually see that it is.  The documentation is perfectly clear
> on the point:
>
>     (It is your responsibility that the byte sequences you create
>     are valid characters in the server character set encoding.)
>
> (This is in 4.1.2.1. String Constants)  If you don't want to deal with
> this, don't use octal escapes to construct multibyte characters.

The database also has a responsibility to protect itself. If you can
insert data into the database so that the stored value is invalid for
the datatype of the column, then it's broken imho.

Having a statement in the doc saying "please don't do this because you
will corrupt the data" doesn't really make the situation better.

/Dennis

pgsql-bugs by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: [HACKERS] bug in timestamp and out of range values
Next
From: Jeff Davis
Date:
Subject: Re: COPY fails on 8.1 with invalid byte sequences in text