According to the docs, the output of a copy command should return a COPY
count.  It turns out this only happens when copying from a file, and not
from STDIN.

> Outputs
> On successful completion, a COPY command returns a command tag of the form
> COPY count
> The count is the number of rows copied.
> 
clone_test_rename=# create temp table aaa (field varchar(255));
CREATE TABLE
Time: 3.806 ms
clone_test_rename=# copy aaa from '/tmp/test.dat';
COPY 3
Time: 0.623 ms
clone_test_rename=# copy aaa from stdin;
Enter data to be copied followed by a newline.
End with a backslash and a period on a line by itself.
>> 123
>> 456
>> hello
>> \.
Time: 8472.305 ms


Tested on 9.3.0
Is there another way I can determine the number of rows copied, short of
performing a pre and post count?   (other than not using stdin, that is).




Reply via email to