Thread: VACCUM VERBOSE ANALYZE

VACCUM VERBOSE ANALYZE

From
Cédric BUSCHINI
Date:
Hello,

I would like to save in a file log from a "VACUUM VERBOSE analyze" perform from psql.
I ve tried different ways :
--------------
[USER@DBsrv] # psql -c'VACUUM VERBOSE analyze' > /home/log_vaccum
--------------
the same command in a script without the '> /home/log_vaccum'
[USER@DBsrv] # vaccum.sh > /home/log_vaccum
--------------
[USER@DBsrv]# psql
Welcome to psql 8.0.3, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

DBsrv=# VACUUM VERBOSE analyze; \o /home/log_vaccum
--------------

.....
but no one worked :(

The log file is created but empty.

Does any one got an idea ?

Cheers

Cedric

Re: VACCUM VERBOSE ANALYZE

From
Tom Lane
Date:
=?ISO-8859-1?Q?C=E9dric_BUSCHINI?= <cbuschini@carax.com> writes:
> I would like to save in a file log from a "VACUUM VERBOSE analyze"
> perform from psql.
> I ve tried different ways :
> --------------
> [USER@DBsrv] # psql -c'VACUUM VERBOSE analyze' > /home/log_vaccum
> --------------

I think that output goes to stderr not stdout.  Try

psql -c'VACUUM VERBOSE analyze' 2> /home/log_vaccum

            regards, tom lane

Re: VACCUM VERBOSE ANALYZE

From
Cédric BUSCHINI
Date:
Thank you Tom. It works !!

Regards,

Cedric

Tom Lane a écrit :
Cédric BUSCHINI <cbuschini@carax.com> writes: 
I would like to save in a file log from a "VACUUM VERBOSE analyze" 
perform from psql.
I ve tried different ways :
--------------
[USER@DBsrv] # psql -c'VACUUM VERBOSE analyze' > /home/log_vaccum
--------------   
I think that output goes to stderr not stdout.  Try

psql -c'VACUUM VERBOSE analyze' 2> /home/log_vaccum
		regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?
              http://www.postgresql.org/docs/faq