pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Daniel Verite <daniel@manitou-mail.org>
To: wim.bertels@ucll.be
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: psql > split > queries & output
Date: Thu, 03 Dec 2020 16:32:11 +0100
Message-ID: <8e16d6cc-3fbb-4789-ac54-b6e92e9d64dd@manitou-mail.org> (raw)
In-Reply-To: <57e6b560f3517ef2da72b4604faabd9af36d3e9c.camel@ucll.be>

	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





view thread (6+ messages)  latest in thread

Message-ID: <8e16d6cc-3fbb-4789-ac54-b6e92e9d64dd@manitou-mail.org>
Permalink:  ../8e16d6cc-3fbb-4789-ac54-b6e92e9d64dd@manitou-mail.org/
Also on:    postgresql.org/message-id/8e16d6cc-3fbb-4789-ac54-b6e92e9d64dd@manitou-mail.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: daniel@manitou-mail.org, wim.bertels@ucll.be
  Subject: Re: psql > split > queries & output
  In-Reply-To: <8e16d6cc-3fbb-4789-ac54-b6e92e9d64dd@manitou-mail.org>
  References: <57e6b560f3517ef2da72b4604faabd9af36d3e9c.camel@ucll.be> <8e16d6cc-3fbb-4789-ac54-b6e92e9d64dd@manitou-mail.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox