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

JDBC COPY error encoding

From: ttvvaa <ttvvaa(at)gmail(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: JDBC COPY error encoding
Date: 2007-08-20 14:18:29
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
I use PostgreSQL 8.2 for WinXP (SP2).
I try to use "postgresql-jdbc-8.2-505-copy-20070719.jdbc3.jar" 

           FileInputStream fs = new FileInputStream("D://t.txt");
           ((PGConnection)con).getCopyAPI().copyIntoDB("COPY table1 FROM
STDIN", fs);

but have error: 'org.postgresql.util.PSQLException: ERROR: invalid byte
sequence for encoding "UTF8": 0xa0'.

file 'D://t.txt' used WIN866 encoding.
DB used UTF8 encoding.

Command successfully runs in psql-console:
      set client_encoding to WIN866;
      copy table1(nn) from 'd://t.txt';

How can I solve this problem?

View this message in context:
Sent from the PostgreSQL - jdbc mailing list archive at


pgsql-jdbc by date

Next:From: j.random.programmerDate: 2007-08-21 04:43:56
Subject: User Defined Types -- Using inet/cdr from JDBC ?
Previous:From: Tom LaneDate: 2007-08-20 03:54:09
Subject: Re: "pg_toast_2772_index" problem

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