Re: psql > split > queries & output

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: wim(dot)bertels(at)ucll(dot)be
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: psql > split > queries & output
Date: 2020-12-03 12:33:07
Message-ID: CAFj8pRA+wZdkU5SrUR2a7j4JguTqg=qhPKZ567fHViA6WU-Whg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

čt 3. 12. 2020 v 12:39 odesílatel Wim Bertels <wim(dot)bertels(at)ucll(dot)be> napsal:

> Hello,
>
> psql shows (the queries and) the output,
> there are for example the -L option and echo_queries option
>
> is there a way to run psql so that:
> * inside psql there are no surprises :) (ignore this line:)
> * one pipe (or..) to a file which only contains the statements
> (queries) history (and not the output)
> * another pipe (or..) to a file which only contains the output (with or
> without the statements) history
>
> why? for example,
> to have easy access in a psql demonstration to past commands
> (history),
> without the output cluttering or overwhelming everything, side by side
> on the screen. (optionally with a third pane for the output)
>
> there is also the /s option in psql,
> but i guess the history is only written to file when psql is closed,
> and is not accessible during the session (only in memory?),
> otherwise this would also be an option
> (not ctrl+r)
>
> suggestions or alternatives while using the commandline?
>

Unfortunately it is not possible. Both contents are sent to stdout. The
own hack can be pretty easy, but without it it is not possible.

Regards

Pavel

> --
> mvg,
> Wim
> --
> https://coronalert.be
>
>
> --
> Always do right. This will gratify some people and astonish the rest.
> -- Mark Twain
>
>
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2020-12-03 12:45:05 Re: Postgres C-API: How to get the Oid for a custom type defined in a schema outside of the current search path
Previous Message Aravindhan Krishnan 2020-12-03 12:27:04 postgres-10 with FIPS