Re: COPY BINARY to stdout

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: keke abe <keke(at)mac(dot)com>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: COPY BINARY to stdout
Date: 2000-10-12 15:04:04
Message-ID: 26208.971363044@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

keke abe <keke(at)mac(dot)com> writes:
> After receiving the 'H' (COPY_OUT) message from the backend,
> how should I tell if the incoming data is in binary format or
> not?

You don't; you just have to know whether you asked for binary or text
copy. At the moment binary copy to/from the frontend is disabled
anyway:
/*
* This restriction is unfortunate, but necessary until the frontend
* COPY protocol is redesigned to be binary-safe...
*/
if (pipe && binary)
elog(ERROR, "COPY BINARY is not supported to stdout or from stdin");

There's a TODO list item to invent a less brain-dead format for binary
COPY data. (The binary cursor representation is not too bad, maybe just
use that.)

In the meantime I suggest forget about COPY BINARY and use DECLARE
BINARY CURSOR instead.

regards, tom lane

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Joseph Shraibman 2000-10-12 20:17:28 Re: [INTERFACES] JDBC Large ResultSet problem + BadTimeStamp Patch
Previous Message Peter Mount 2000-10-12 14:15:53 Re: JDBC Large ResultSet problem + BadTimeStamp Patch