I wrote:
> I can't test psql binary \copy just yet, but will look at applying your
> recent patch so that case can be checked.
With patch applied:
$ time psql -c "\\copy t to '/home/tgl/t.out2'" bytea
real 3m46.057s
user 0m2.724s
sys 0m36.118s
$ time psql -c "\\copy t to '/home/tgl/t.outb2' binary" bytea
real 1m5.222s
user 0m0.640s
sys 0m6.908s
$ ls -l t.*
-rw-rw-r-- 1 tgl tgl 5120001024 May 26 16:02 t.out2
-rw-rw-r-- 1 tgl tgl 1024006165 May 26 16:03 t.outb2
The binary time is just slightly more than what I got before for a
server COPY:
bytea=# copy t to '/home/tgl/t.out';
COPY 1024
Time: 273325.666 ms
bytea=# copy binary t to '/home/tgl/t.outb';
COPY 1024
Time: 62113.355 ms
So those numbers seem to hang together, and it's just the text case
that is not making too much sense. I'm off for a little visit with
oprofile...
regards, tom lane