Thread: COPY from files does not work

COPY from files does not work

From
"Llew"
Date:
I am using pq++ and am having problems getting the COPY command to work. I
am using this to inport huge files (700 Mb) at a time. The thing is if I do
it manually or even via psql, the same SQL commands work. The really odd
thing is that this fails:
CREATE TABLE temp1 (a integer, b integer);
COPY BINARY temp to '/local/temp_table.bin'
COPY BINARY temp from '/local/temp_table.bin'

I am calling PgDatabase.ExecCommandOk and getting error messages like
ERROR: copy: line 18, COPY BINARY: unexpected EOF
ERROR: COPY BINARY: file signature not recognized

Help! Does the C/C++ library bindings force postgresql to look in odd places
for COPY or something. I am at my wits end.

Llew




Re: COPY from files does not work

From
"Llew"
Date:
Sorry to waste everyone' time:
I just hadn't close the file handles and presumably the data wasn't flushed.
Duh. Egg on face.
Llew