Thread: Vacuum output redirect

Vacuum output redirect

From
"Wim Chalmet"
Date:
Hi,
 
Sorry for my basic question here, but I can't figure things out. I am running postgres in a windows environment. I would like to redirect the output from a "vacuum full analyze verbose;" to a text file. How do I do this?
 
I have tried this (the file "run_vacuum.sql" just contains this one line - without quotes of course: "vacuum full analyze verbose;" )
psql -d sirius_lm -U postgres -f run_vacuum.sql -o vacuum.log
 
And also this:
psql -d sirius_lm -U postgres -f run_vacuum.sql >vacuum.log
 
But none of that works. Can anybody help a beginner out? Thanks!

--
Do you want to make a difference? Issue a microloan at www.kiva.org.

Re: Vacuum output redirect

From
Raymond O'Donnell
Date:
On 04/12/2007 15:27, Wim Chalmet wrote:

> Sorry for my basic question here, but I can't figure things out. I am
> running postgres in a windows environment. I would like to redirect the
> output from a "vacuum full analyze verbose;" to a text file. How do I do
> this?

You could use the standalone program vacuumdb and redirect its output, thus:

   vacuumdb -U postgres your_database >out.txt 2>&1

HTH

Ray.

---------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
---------------------------------------------------------------


Re: Vacuum output redirect

From
"Martin Gainty"
Date:
does psql have write access to the folder?

M-
----- Original Message -----
Sent: Tuesday, December 04, 2007 10:27 AM
Subject: [GENERAL] Vacuum output redirect

Hi,
 
Sorry for my basic question here, but I can't figure things out. I am running postgres in a windows environment. I would like to redirect the output from a "vacuum full analyze verbose;" to a text file. How do I do this?
 
I have tried this (the file "run_vacuum.sql" just contains this one line - without quotes of course: "vacuum full analyze verbose;" )
psql -d sirius_lm -U postgres -f run_vacuum.sql -o vacuum.log
 
And also this:
psql -d sirius_lm -U postgres -f run_vacuum.sql >vacuum.log
 
But none of that works. Can anybody help a beginner out? Thanks!

--
Do you want to make a difference? Issue a microloan at www.kiva.org.

Re: Vacuum output redirect

From
"Wim Chalmet"
Date:
Yes, the write access is fine. I think I have a problem with syntax. I don't know if there is a command switch on psql to redirect standard output to a logfile. THere is one for any query results, but that does not happen to contain the output of vacuum.

On 12/4/07, Martin Gainty <mgainty@hotmail.com> wrote:
does psql have write access to the folder?

M-
----- Original Message -----
Sent: Tuesday, December 04, 2007 10:27 AM
Subject: [GENERAL] Vacuum output redirect

 
Hi,
 
Sorry for my basic question here, but I can't figure things out. I am running postgres in a windows environment. I would like to redirect the output from a "vacuum full analyze verbose;" to a text file. How do I do this?
 
I have tried this (the file "run_vacuum.sql" just contains this one line - without quotes of course: "vacuum full analyze verbose;" )
psql -d sirius_lm -U postgres -f run_vacuum.sql -o vacuum.log
 
And also this:
psql -d sirius_lm -U postgres -f run_vacuum.sql >vacuum.log
 
But none of that works. Can anybody help a beginner out? Thanks!

--
Do you want to make a difference? Issue a microloan at www.kiva.org.



--
Do you want to make a difference? Issue a microloan at www.kiva.org.