Re: psql and named pipes

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: psql and named pipes
Дата
Msg-id 29493.1206646511@sss.pgh.pa.us
обсуждение исходный текст
Ответ на psql and named pipes  (Alvaro Herrera <alvherre@commandprompt.com>)
Список 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 по дате отправления:

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Indexing for Expression type data using GIST
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Commit fest status