Re: psql > split > queries & output

Поиск
Список
Период
Сортировка
От Wim Bertels
Тема Re: psql > split > queries & output
Дата
Msg-id 57e6b560f3517ef2da72b4604faabd9af36d3e9c.camel@ucll.be
обсуждение исходный текст
Ответ на Re: psql > split > queries & output  ("Daniel Verite" <daniel@manitou-mail.org>)
Ответы Re: psql > split > queries & output
Список pgsql-general
Daniel Verite schreef op do 03-12-2020 om 15:18 [+0100]:
>     Wim Bertels wrote:
> 
> > * one pipe (or..) to a file which only contains the statements
> > (queries) history (and not the output)
> > * another pipe (or..) to a file which only contains the output
> > (with or
> > without the statements) history
> 
> Consider that script:
> 
> $ cat f.sql
> \set ECHO queries
> \o output.txt
> select 1;
> select 2;
> select 3;
> 
> If it's run with
> 
> $ psql -f f.sql >queries.txt
> 
> then it produces the queries in queries.txt and the output in
> output.txt


thank you,
i use the same with a input file,
but interactively this doesn't seem to work

ie 
psql > queries.txt (does not work (stdout))
(psql 2> queries.txt does work (stderr))
(psql &> queries.txt does not work (both))

--

psql -f - > out 

does work interactively,
but no fun experience :) (no completion, and the separation does not
seem to work)

> 
> 
> Best regards,
-- 
mvg,
Wim 
--
https://coronalert.be

--
If you laid all of our laws end to end, there would be no end.
        -- Mark Twain




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

Предыдущее
От: "Daniel Verite"
Дата:
Сообщение: Re: psql > split > queries & output
Следующее
От: "Daniel Verite"
Дата:
Сообщение: Re: psql > split > queries & output