Re: complete output to file??

From: missive(at)frontiernet(dot)net (Lee Harr)
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: complete output to file??
Date: 2001-10-04 00:09:42
Message-ID: 9pg9c5$1b7d$1@news.tht.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

> I use \o [file] to get output to a file but it only records the
> command. For example:
>
> \o vac.out
> vacuum verbose analyze;
>
> I end up with one row "VACUUM" in vac.out. I want the entire output that I
> see on the screen to go to a file. How is this done?
>

I am not sure how to do this entirely within psql, but you can always
use the vacuumdb command or the -c flag to psql...

vacuumdb --verbose --analyze -d databasename >& output.txt
psql -c 'vacuum verbose analyze' databasename >& output.txt

Note that you must redirect both stdout and stderr to your file
in order to see everything. That seems to be why \o is not catching
the output that you want.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message hodges 2001-10-04 13:24:22 Re: Authorization problem
Previous Message postgresql 2001-10-03 21:25:12 help with an install problem