Re: Redirecting select() output generates error

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Redirecting select() output generates error
Date: 2018-10-29 19:06:37
Message-ID: CAKFQuwYYqWZKuBratGFJJpV50C-oM-3UC55bV7g+r7FHLLqzPA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Monday, October 29, 2018, Rich Shepard <rshepard(at)appl-ecosys(dot)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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rich Shepard 2018-10-29 19:21:16 Re: Redirecting select() output generates error
Previous Message Rich Shepard 2018-10-29 18:59:35 Re: Redirecting select() output generates error