Thread: copy from stdin blocks?

copy from stdin blocks?

From
"Christoph Schlarmann"
Date:
Hi out there,

I've got the following problem with postgresql 7.1.3 (linux Kernel
2.2.16-SMP and Kernel 2.4.16, bash):

I tried to copy data from stdin to postgresql in a pipe. If the data size
exeeds the size of the stdin buffer, the process doesn't return.

simplified example (copy from file works fine, but my intention is to copy
from stdin):

cat data_file |  psql database -c "copy table from stdin delimiters ';' with
null as '';"

With a small amount of data everything works fine. I'm a little bit confused
because I didn't find any hints concerning this problem surfing the net and
due to the character of the problem it should be a major problem. Did I miss
something ?

 Any help is greatly appreciated,

Thanks
Christoph


Re: copy from stdin blocks?

From
Tom Lane
Date:
"Christoph Schlarmann" <cschlarm@abashh.de> writes:
> I've got the following problem with postgresql 7.1.3 (linux Kernel
> 2.2.16-SMP and Kernel 2.4.16, bash):

> I tried to copy data from stdin to postgresql in a pipe. If the data size
> exeeds the size of the stdin buffer, the process doesn't return.

I can't reproduce this in current sources, on either HPUX 10.20 or
Red Hat 7.2 Linux.  Perhaps an old psql bug?

            regards, tom lane