Michael Robinson <robinson(at)netrinsics(dot)com> writes:
> testdb=> create table foo (word varchar(30));
> CREATE
> testdb=> insert into foo values ('\217\210');
> INSERT 2337289 1
> testdb=> copy "foo" to '/usr/local/pgsql/foo.out';
> COPY
> testdb=> \q
> % od -c foo.out
> 0000000 217 210 \0 \n
> 0000004
Hmm. I get
0000000 217 210 \n
0000003
with either current sources or 6.5.3. I don't have MULTIBYTE nor
USE_LOCALE turned on, though. What is your configuration exactly?
This looks to me like something is deciding that \217 must be the
start of a 3-byte multibyte character... in which case, it should have
appeared that way in your database, I think.
regards, tom lane