Search Postgresql Archives

Re: psql > split > queries & output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



	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


Best regards,
-- 
Daniel Vérité
PostgreSQL-powered mailer: https://www.manitou-mail.org
Twitter: @DanielVerite






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux