> The existing COPY BINARY file format is entirely brain-dead 
> anyway; for example, it wants the number of tuples to be stored
> at the front, which means we have to scan the whole relation an
> extra time to get that info. Its handling of nulls is bizarre, too.
> I'm thinking this might be a good time to abandon backwards
> compatibility and switch to a format that's a little easier to read
> and write.  Does anyone have an opinion pro or con about that?

Switch to new format.

Vadim

Fri, 1 Dec 2000 14:47:48 -0800 
"Mikheev, Vadim" <vmikheev@SECTORBASE.COM>
RE: COPY BINARY is broken...
Hi,

	I would very much like some way of writing binary data to a database.
Copy binary recently broke on me after upgrading to 7.0. I have large
simulation codes and writing lots of floats to the database by
converting them to text first is 1) a real pain, 2) slow and 3) can lead
to unexpected loss in precision. 

I think binary writes would actually be solved better and safer through
some type of CORBA interface, but previous discussions seemed to
indicate that that is even more of a pain than fixing the current binary
interface.

So I agree that the current version is a problem, but I do think
something needs to be put in place. Not everybody only writes a few
numbers from a web page into the database -- some have masses of data to
dump into a database. For all I care it doesn't even have to look like
SQL, but can be purely accessible through libpq.

Adriaan

Sun, 03 Dec 2000 18:44:29 +0200
Adriaan Joubert <a.joubert@albourne.com>
Re: COPY BINARY is broken...
Adriaan Joubert <a.joubert@albourne.com> writes:
> Copy binary recently broke on me after upgrading to 7.0.

I think you're talking about binary copy via the frontend, which has a
different set of problems.  To fix that, we need to make some protocol
changes, which would (preferably) also apply to non-binary frontend
copy, which would create a compatibility problem.  (The reason the
protocol is broken is there's no reasonable way to find or signal the
end of the COPY data stream after an error.)

I think that's worth doing, but there's no time to design and implement
it for 7.1.  Maybe for 7.2.

> I think binary writes would actually be solved better and safer through
> some type of CORBA interface,

CORBA would provide a more machine-independent interface, but migrating
to CORBA would be a huge task, and I'm not sure the payoff is worth
it...

			regards, tom lane

Sun, 03 Dec 2000 12:10:02 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: COPY BINARY is broken... 