Search Postgresql Archives

Re: Parsing COPY ... WITH BINARY

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

 



On Thu, Jan 31, 2013 at 8:47 AM, Leonardo M. Ramé <l.rame@xxxxxxxxxxx> wrote:
> I'm using this:
>
> COPY( select field1, field2, field3 from table ) TO 'C://Program Files/PostgreSql//8.4//data//output.dat' WITH BINARY
>
> To export some fields to a file, one of them is a ByteA field. Now, I
> need to read the file with a custom made program.
>
> How can I parse this file?
>
> BTW: I cannot export as CSV, because the binary data is modified when I
> do that.

this type of thing is probably better handled with libpq based C
application if you're willing to write one.  all this is assuming you
don't want to decode your bytea from encoded format such as hex.  why
do you specifically need to dump in binary?

merlin


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