Sunday, July 13, 2008

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

"Stephen R. van den Berg" <srb@cuci.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

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

No comments: