Re: psql > split > queries & output

From: Wim Bertels <wim(dot)bertels(at)ucll(dot)be>
To: Daniel Verite <daniel(at)manitou-mail(dot)org>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: psql > split > queries & output
Date: 2020-12-04 10:09:36
Message-ID: 8b9f341707fd81d0ab90eedb654432eec4ffe847.camel@ucll.be
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Olivier Gautherot 2020-12-04 10:14:37 Re: Alter the column data type of the large data volume table.
Previous Message Olivier Gautherot 2020-12-04 08:44:06 Re: Alter the column data type of the large data volume table.