Search Postgresql Archives

Re: Getting "insufficient data left in message" on copy with binary

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Gordon Shannon <gordo169@xxxxxxxxx> writes:
> Got it.  The problem was a combination of 2 mis-matched data types. 
> ...
> So, my fault, and the fix is obvious.  But it does seem like a less than
> ideal error message.

The binary format is sufficiently non-redundant that it's hard for the
code to know just what is wrong.  In this case the first data column
was slurping up bits that belonged to the second column, leaving not
enough data for the second column when it came time to read that.

> Also, maybe a sentence like this would be helpful on the COPY page: "Be
> careful that the data types match from 'copy to' to 'copy from'.  There is
> no implicit conversion done in binary mode..." or some such?

I added this text:

***************
*** 300,305 ****
--- 300,309 ----
      somewhat faster than the normal text mode, but a binary-format
      file is less portable across machine architectures and
      <productname>PostgreSQL</productname> versions.
+     Also, the binary format is very data type specific; for example
+     it will not work to output binary data from a <type>smallint</> column
+     and read it into an <type>integer</> column, even though that would work
+     fine in text format.
     </para>
  
     <para>

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux