Search Postgresql Archives

Re: psql client quits after 1st command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 02, 2007 at 05:26:03PM +0100, Vincenzo Romano wrote:
> > psql gets an EOF on the named pipe when the first shell command
> > exits.  You need to batch all your commands and send them in one shell
> > command, so it keeps the pipe open until it's done.
> >
> > -Doug
> 
> Using "echo -n" instead of the plain "echo" to avoid sending the EOL makes the
> psql client behaving the same way: quitting after the first complete command.
> This makes useless the input redirection from anything other than a file.

No, it's exactly as he said: the FIFO only works once. As soon as
you've piped something into it and the echo closes the pipe, it closes
for psql also. As far as it's concerned you've quit, so it exits.

Replace the psql commmand with "cat" and you'll see exactly the same
effect.

I don't think you can acheive the effect you want with a FIFO. Maybe a
UDP socket will work as it doesn't require a permanent connection.

Hope this helps,
-- 
Martijn van Oosterhout   <kleptog@xxxxxxxxx>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment: signature.asc
Description: Digital signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux