Skip site navigation (1) Skip section navigation (2)

COPY fails on 8.1 with invalid byte sequences in text types

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: COPY fails on 8.1 with invalid byte sequences in text types
Date: 2006-10-27 21:42:41
Message-ID: 1161985361.31124.139.camel@dogma.v10.wvs (view raw or flat)
Thread:
Lists: pgsql-bugs
You can insert invalid UTF8 bytes sequences into a TEXT type on an 8.1
installation by doing something like:

INSERT INTO foo(t) VALUES('\xFF');

Then, you can do a:

COPY foo TO '/some/file';

but if you try to do a:

COPY foo FROM '/some/file';

That will fail because /some/file contains invalid UTF8 sequences, even
though it's the same file you copied out.

It seems to be essentially a data corruption issue if applications
insert binary data in text fields using escape sequences. Shouldn't
PostgreSQL reject an invalid UTF8 sequence in any text type?

Regards,
	Jeff Davis


Responses

pgsql-bugs by date

Next:From: Jeff DavisDate: 2006-10-27 22:38:05
Subject: Re: COPY fails on 8.1 with invalid byte sequences in text
Previous:From: Henrique Lavnis // iKernelTechDate: 2006-10-27 17:43:53
Subject: Drive ODBC

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group