Re: psql and named pipes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psql and named pipes
Date: 2008-03-27 19:35:11
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> I was under the impression that I could start a "psql -f pipe" and then
> feed it commands through the pipe using echo, and expect it to hang from
> one command to the next. Of course, this doesn't work -- my guess is
> that echo sends an EOF after the line I send, so psql sees the EOF in
> the pipe and terminates.

Right. You need some (other?) process holding the write end of the pipe
open continuously until you're done with the session.

There isn't really any such concept as "sending an EOF" here. The read
side of the pipe reports EOF if there are no processes holding the write
side open. More data could be sent by a new writer, but of course psql
has no idea about that.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-03-27 19:45:33 Re: Windows shared_buffers limitations
Previous Message Martijn van Oosterhout 2008-03-27 19:34:04 Re: Indexing for Expression type data using GIST