Re: psql > split > queries & output - Mailing list pgsql-general

From Daniel Verite
Subject Re: psql > split > queries & output
Date
Msg-id 8e16d6cc-3fbb-4789-ac54-b6e92e9d64dd@manitou-mail.org
Whole thread Raw
In response to Re: psql > split > queries & output  (Wim Bertels <wim.bertels@ucll.be>)
Responses Re: psql > split > queries & output  (Wim Bertels <wim.bertels@ucll.be>)
List pgsql-general
    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



pgsql-general by date:

Previous
From: Wim Bertels
Date:
Subject: Re: psql > split > queries & output
Next
From: Michael Lewis
Date:
Subject: Re: Alter the column data type of the large data volume table.