Search Postgresql Archives

Re: psql > split > queries & output

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

 



	Wim Bertels wrote:

> but interactively this doesn't seem to work

Interactively something like this might do the job:

$  PSQL_HISTORY=/tmp/queries.txt psql  -L /tmp/logfile.txt

After running some queries, and a clean exit from psql:

$ cat /tmp/queries.txt
select 1;
select 2;


$ cat /tmp/logfile.txt 
********* QUERY **********
select 1;
**************************

 ?column? 
----------
	1
(1 row)

********* QUERY **********
select 2;
**************************

 ?column? 
----------
	2
(1 row)


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