Re: I want the stupidest possible binary export

From: David Rysdam <drysdam(at)ll(dot)mit(dot)edu>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: I want the stupidest possible binary export
Date: 2014-09-18 14:56:10
Message-ID: 87ioklrn91.fsf@loud.ll.mit.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> writes:
>> psql -t -c "\copy (select mybinaryfield from mytable where key = 1) to
>> 'file'" with format binary
>
> From here:
>
> http://www.postgresql.org/docs/9.2/static/app-psql.html
>
> the above should be:
>
> psql -t -c "\copy (select mybinaryfield from mytable where key = 1) to
> 'file'" with binary

OK, good, that works. However, now I have the problem I suspected I
would: I get more than just the bytes that were in my field. 27 bytes
more, to be exact.

I already did -t for tuples-only and I'm only doing one row and column
so there's no separators there. Since it's a .gz file and 'file' no
longer recognizes it, I deduce that the magic cookie isn't at the
beginning of the file anymore and some of the 27 bytes must be at the
beginning of the file instead.

Is this a PG-specific binary format with a wrapper around my data or
just my data only?

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Rysdam 2014-09-18 14:58:00 Re: I want the stupidest possible binary export
Previous Message Jov 2014-09-18 14:55:33 Re: I want the stupidest possible binary export