Getting "insufficient data left in message" on copy with binary - Mailing list pgsql-general

From Gordon Shannon
Subject Getting "insufficient data left in message" on copy with binary
Date
Msg-id 25282935.post@talk.nabble.com
Whole thread Raw
Responses Re: Getting "insufficient data left in message" on copy with binary  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Hello,

I'm running 8.4 on Linux/Centos.  I am doing a "copy (select ....) to
'/absolute/path/to/file.dat' with binary". That works fine.  But when I load
that file into a table...

  copy mytable (id, mlid, parent_mlid, author_id, date_id, time_id,
content_type_id, provider_id,
    is_duplicate, is_spam, language_code, profanity, tonality, sentiment,
created_time, updated_at)
  from '/absolute/path/to/file.dat' with binary;

  ERROR:  insufficient data left in message
  CONTEXT:  COPY mytable, line 1, column provider_id

The same data works fine without the "with binary".  Also, the column it's
complaining about, provider_id, is a NOT NULL column, and the data is
definitely there -- i.e. not a NULL in data file.

I have searched for this message and mostly I see issues related to JDBC
drivers, so that doesn't appear relevant.  And they all talk about nul bytes
(0x00), but again, how can that be relevant when I'm in binary mode?  Seems
like it should understand null bytes here, if that's what this is about.

Anybody seen this?

Thanks,
Gordon

--
View this message in context:
http://www.nabble.com/Getting-%22insufficient-data-left-in-message%22-on-copy-with-binary-tp25282935p25282935.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


pgsql-general by date:

Previous
From: Josef Wolf
Date:
Subject: Re: pg_ctl with unix domain socket?
Next
From: Adam Rich
Date:
Subject: New server disk setup?