Problem with copyIn(String sql, Reader from)

From: Leonardo F <m_lists(at)yahoo(dot)it>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Problem with copyIn(String sql, Reader from)
Date: 2010-04-08 13:03:35
Message-ID: 234987.48841.qm@web29001.mail.ird.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi,

I tried to use copyIn(final String sql, Reader from) but I always got weird errors:

ERROR: invalid byte sequence for encoding "UTF8": 0x00

I think there's a problem in CopyManager.java, the line:

byte[] buf = encoding.encode(new String(cbuf));

should be

byte[] buf = encoding.encode(new String(len));

???

Otherwise the string to be encoded has always bufferSize length... filled with 0x0...

Am I right?

Everything works fine with the InputStream version.

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Leonardo F 2010-04-08 13:34:13 Re: Problem with copyIn(String sql, Reader from)
Previous Message Craig Ringer 2010-04-07 12:54:10 Re: An I/O error occured while sending to the backend.