X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id AF0E59FA6B2 for ; Tue, 8 Aug 2006 17:05:54 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 09159-01 for ; Tue, 8 Aug 2006 20:05:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.169]) by postgresql.org (Postfix) with ESMTP id 7B0F59FA666 for ; Tue, 8 Aug 2006 17:05:43 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id m3so255519ugc for ; Tue, 08 Aug 2006 13:05:42 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=PFQ0+orlQCZa2smpLLzTIX5ptMMkumzByhxvkPm+r6VdzUIuDJL2VKNtu/U990X54vkyCJqKUInqop/4R9vBqCr43HYsTKz4qqyFYKCaE1McJJBpuG32MCMMjbnD/7188c0Vf0Lshjcj4PNFztsKHO1CqqwgJpcssBVYdQhwUqE= Received: by 10.78.175.14 with SMTP id x14mr6802hue; Tue, 08 Aug 2006 13:05:41 -0700 (PDT) Received: by 10.78.32.10 with HTTP; Tue, 8 Aug 2006 13:05:41 -0700 (PDT) Message-ID: Date: Tue, 8 Aug 2006 15:05:41 -0500 From: "Aaron Bono" To: "Nicola Mauri" Subject: Re: Getting rid of postgres output Cc: pgsql-admin@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_16493_32284676.1155067541384" References: X-Google-Sender-Auth: 3396c52529918d4c X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.496 tagged_above=0 required=5 tests=HTML_40_50, HTML_MESSAGE, SPF_PASS X-Spam-Level: X-Archive-Number: 200608/95 X-Sequence-Number: 22639 ------=_Part_16493_32284676.1155067541384 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 8/7/06, Nicola Mauri 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 ================================================================== ------=_Part_16493_32284676.1155067541384 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 8/7/06, Nicola Mauri <Nicola.Mauri@saga.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
================================================================== ------=_Part_16493_32284676.1155067541384--