Re: COPY command, support for mixing binary and text columns?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Stephen R(dot) van den Berg" <srb(at)cuci(dot)nl>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: COPY command, support for mixing binary and text columns?
Date: 2008-07-13 16:47:53
Message-ID: 10473.1215967673@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Stephen R. van den Berg" <srb(at)cuci(dot)nl> writes:
> Am I correct in the assumption that even though the network protocol
> specifically allows individual columns of a copy command to be
> binary or text format, the current COPY command in 8.3 doesn't
> support specifying that?

Yeah, the protocol is a bit more general than the actual file format.
The text COPY format really couldn't support mixed text and binary
fields at all, of course; and as for the binary format, the COPY
reference page says:

: Presently, all data values in a COPY BINARY file are assumed to be in
: binary format (format code one). It is anticipated that a future
: extension might add a header field that allows per-column format codes
: to be specified.

But it's been like that since PG 7.4, and no one's gotten motivated
to complete the feature, so don't hold your breath ;-)

AFAIK there are no client libraries that actually pay any attention to
the protocol's format codes anyway --- they just push the COPY data
through uninterpreted.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-07-13 17:16:06 Re: PATCH: CITEXT 2.0 v3
Previous Message Stephen R. van den Berg 2008-07-13 16:24:56 COPY command, support for mixing binary and text columns?