fatal copy in/out error (6.5.3) - Mailing list pgsql-hackers

From Michael Robinson
Subject fatal copy in/out error (6.5.3)
Date
Msg-id 200001241112.TAA20988@netrinsics.com
Whole thread Raw
Responses Re: [HACKERS] fatal copy in/out error (6.5.3)
List pgsql-hackers
Do this:
   testdb=> create table foo (word varchar(30));   CREATE   testdb=> insert into foo values ('\217\210');   INSERT
23372891   testdb=> copy "foo" to '/usr/local/pgsql/foo.out';   COPY   testdb=> \q   % od -c foo.out   0000000  217 210
\0  \n                                                   0000004
 

One run produced:   0000000  217 210  \0  \b  \n                                                

In all cases, though, it emits a null.  This, of course, causes "copy from" to
fail when it tries to parse a null-containing field in a multi-field record.

As for what the sequence "\217\210" represents, that's not really relevant
(it's not even a valid Chinese character, so far as I can tell).  Someone 
just entered this into our web interface and broke our database.
-Michael Robinson

P.S. As an aside, if "copy from" recognizes the \xxx octal convention, why
doesn't "copy to" use it to represent everything outside of \040..\176?


pgsql-hackers by date:

Previous
From: Zeugswetter Andreas SB
Date:
Subject: Re: [HACKERS] column aliases
Next
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] Happy column dropping