From: Wim Bertels <wim.bertels@ucll.be>
To: Daniel Verite <daniel@manitou-mail.org>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: psql > split > queries & output
Date: Fri, 04 Dec 2020 11:09:36 +0100
Message-ID: <8b9f341707fd81d0ab90eedb654432eec4ffe847.camel@ucll.be> (raw)
In-Reply-To: <8e16d6cc-3fbb-4789-ac54-b6e92e9d64dd@manitou-mail.org>
References: <8e16d6cc-3fbb-4789-ac54-b6e92e9d64dd@manitou-mail.org>
Daniel Verite schreef op do 03-12-2020 om 16:32 [+0100]:
> 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:
yes indeed,
but as i mentioned in the beginning,
i can't consult the current history in a side pane,
only with option /s
(while still running the psql session)
(side note:
$ echo $PSQL_HISTORY (is empty)
$ psql
psql (12.5 (Debian 12.5-1.pgdg100+1))
Type "help" for help.
# \set HISTFILE /tmp/test
# select 1;
has no effect, /tmp/test is not created,
everything is put into ~.psql_history )
(debian specific?, intended?, or bug?)
>
> $ 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,
--
mvg,
Wim
--
https://coronalert.be
--
In India, "cold weather" is merely a conventional phrase and has come into
use through the necessity of having some way to distinguish between weather
which will melt a brass door-knob and weather which will only make it mushy.
-- Mark Twain
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: wim.bertels@ucll.be, daniel@manitou-mail.org
Subject: Re: psql > split > queries & output
In-Reply-To: <8b9f341707fd81d0ab90eedb654432eec4ffe847.camel@ucll.be>
References: <8e16d6cc-3fbb-4789-ac54-b6e92e9d64dd@manitou-mail.org> <8b9f341707fd81d0ab90eedb654432eec4ffe847.camel@ucll.be>
* 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