Re: Redirecting select() output generates error - Mailing list pgsql-general

From David G. Johnston
Subject Re: Redirecting select() output generates error
Date
Msg-id CAKFQuwYYqWZKuBratGFJJpV50C-oM-3UC55bV7g+r7FHLLqzPA@mail.gmail.com
Whole thread Raw
In response to Re: Redirecting select() output generates error  (Rich Shepard <rshepard@appl-ecosys.com>)
Responses Re: Redirecting select() output generates error  (Rich Shepard <rshepard@appl-ecosys.com>)
Re: Redirecting select() output generates error  (Rich Shepard <rshepard@appl-ecosys.com>)
List pgsql-general
On Monday, October 29, 2018, Rich Shepard <rshepard@appl-ecosys.com> wrote:
On Mon, 29 Oct 2018, Rich Shepard wrote:

But, when I try to redirect output to a disk file like this,
\o data-summary-by-form.txt
the result is an error:

  The \o came from a stackexchange thread I found with a web search. Within
psql the \? help command indicates there is no \o option, but \g should do
the same thing. It doesn't. I'm still confused on how to redirect output to
a file.

  A clue stick is needed.


You seem to need to distinguish between the command line options to psql and the meta commands that can be used within a script that is being executed by psql.

You should probably show all shell and commands and the psql script in full instead of bits and pieces.

This stuff does work and nothing you’ve shown as having executed is wrong so that error is coming from something you haven’t shown.

Read the psql documentation.

You can either use \out or \copy within psql script or redirect the shell output using shell features.

David J.

pgsql-general by date:

Previous
From: Rich Shepard
Date:
Subject: Re: Redirecting select() output generates error
Next
From: Rich Shepard
Date:
Subject: Re: Redirecting select() output generates error