Search Postgresql Archives

Re: how to load text file that has embeded nul character

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

 



Sun Dong wrote:

> When I tried to load it, I always get this error:
>  invalid byte sequence for encoding "UTF8": 0x00
> 
> how could I load this into postgresql database? 

I'm afraid you'll have to preprocess the file to convert the 0x00 into
\000.  Obviously, if you're inserting this file into a text field or
similar, the data will be truncated at that point; if you want the data
after the NUL to be preserved, you'll need a bytea field (or change the
NUL to something else).

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

-- 
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