copy binary from stdin; Why is it broken?

From: Adriaan Joubert <a(dot)joubert(at)albourne(dot)com>
To: Postgresql <pgsql-hackers(at)postgreSQL(dot)org>
Subject: copy binary from stdin; Why is it broken?
Date: 2000-06-30 08:04:11
Message-ID: 395C547B.101A546C@albourne.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

For speed I had a programme (actually a CORBA server) that would
receive a lot of records, copy them into a binary record and copied them
into the database. As this is a CORBA server on the same machine as the
database, there are no endedness problems or anything like that. This
worked just great until the latest update: now I get 'COPY BINARY is not
supported to stdout or from stdin'. In the context of psql there may be
good reasons for this, but from a programme it works well, so why
disallow it? Now I've got to go and convert everything to a load of
printf's, which are then converted back into binary -- seems kind-of
silly. And I'm not comfortable with these types of conversions for
floats at all.

On a separate note: what would be really great for loading large amounts
of data into a database is if one could have a serial field that
updated anyway. Some databases give you the next serial value if you try
to insert null -- which seems reasonable in the context of a SERIAL,
which is NOT NULL. I can see that this may cause problems in the case of
fields that do a default nextval('sequence'), and which consequently can
be null, but the benefits would be large.

Often simulations or sensors (we have both) generate large streams of
binary data and a way of loading this data into the database rapidly is
very, very useful.

Adriaan

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message D'Arcy J.M. Cain 2000-06-30 11:54:41 Re: postgres - development of inet/cidr
Previous Message Philip Warner 2000-06-30 05:27:53 Modified pg_dump & new pg_restore need testing...