Re: Getting rid of postgres output

From: "Aaron Bono" <postgresql(at)aranya(dot)com>
To: "Nicola Mauri" <Nicola(dot)Mauri(at)saga(dot)it>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Getting rid of postgres output
Date: 2006-08-08 20:05:41
Message-ID: bf05e51c0608081305j27592a85p781fc6fe274075a3@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On 8/7/06, Nicola Mauri <Nicola(dot)Mauri(at)saga(dot)it> wrote:
>
>
> I scheduled a dump between two databases, via network:
>
> pg_dump --clean -U postgres mydb | psql -q -h remote_host -d mydb -U
> postgres
>
> I'd like to have no output being generated, unless an error condition
> occurs, so that crond will email me only when something goes really wrong.
> Unfortunately I'm getting this output:
>
> setval
> --------
> 551776
> (1 row)
>
> setval
> --------
> 340537
> (1 row)
>
> setval
> --------
> 10411
> (1 row)
>
> and so on........
> It seems to be related to some sequences recently added to the database.
> Actually we are getting one 'setval' line for each sequence defined.
>
> Does anyone know how to get rid of this output?
> Simply redirecting output is not a great idea, as we may loose some
> precious error messages too; so I think we should prevent this messages to
> being generate at all.
> (Postgres 8.1.3 on RHEL4)
>

Have you tried redirecting standard output to /dev/null and sending the
errors to your email? For example:

pg_dump --clean -U postgres mydb | psql -q -h remote_host -d mydb -U
postgres > /dev/null 2> output_to_be_emailed.txt

==================================================================
Aaron Bono
Aranya Software Technologies, Inc.
http://www.aranya.com
http://codeelixir.com
==================================================================

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Thomas Vatter 2006-08-08 20:17:46 Silent installation and user accounts
Previous Message Aaron Bono 2006-08-08 18:36:45 Re: Strange UTF8 issue with pg_dump/pg_restore