Re: psql and named pipes

Поиск
Список
Период
Сортировка
От Aidan Van Dyk
Тема Re: psql and named pipes
Дата
Msg-id 20080327175503.GU6497@yugib.highrise.ca
обсуждение исходный текст
Ответ на Re: psql and named pipes  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-hackers
* Alvaro Herrera <alvherre@commandprompt.com> [080327 13:51]:
> Ah!  Yeah, I knew that and forgot :-)  It's easier than that actually --
> you just need to keep the pipe open in another process.  So I can do
> this: first open a terminal with
>
> $ psql -f foo
>
> And then, in another terminal,
>
> $ cat > foo &
> [1] 29155
>
> [1]+  Stopped                 cat >foo
> $ echo "begin;" > foo
> $ echo "create table a (a int);" > foo
> $ echo "insert into a values (1);" > foo
> $ echo "insert into a values (2);" > foo
> $ echo "insert into a values (3);" > foo
> $ echo "commit;" > foo
> $ echo "select * from a;" > foo
> $ kill %1
> -bash: echo: write error: Appel système interrompu
> [1]+  Complété              cat >foo
>
>
> And while this is going on, the other terminal shows the output being
> produced by psql.
>
> Thanks for the reminder :-)

And thanks for the "any open writer" trick.  Makes it even easier for me
to keep using named pipes with psql.

--
Aidan Van Dyk                                             Create like a god,
aidan@highrise.ca                                       command like a king,
http://www.highrise.ca/                                   work like a slave.

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: psql and named pipes
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: [PATCHES] CopyReadLineText optimization