Re: psql and named pipes - Mailing list pgsql-hackers

From Tom Lane
Subject Re: psql and named pipes
Date
Msg-id 29493.1206646511@sss.pgh.pa.us
Whole thread Raw
In response to psql and named pipes  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.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


pgsql-hackers by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Indexing for Expression type data using GIST
Next
From: Simon Riggs
Date:
Subject: Re: Commit fest status