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 1239C9FB276 for ; Tue, 8 Aug 2006 18:21:51 -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 16308-09 for ; Tue, 8 Aug 2006 21:21:42 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from exchange.g2switchworks.com (mail.g2switchworks.com [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id E581B9FB26A for ; Tue, 8 Aug 2006 18:21:41 -0300 (ADT) Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; Tue, 8 Aug 2006 21:21:39 +0000 Received: from state.g2switchworks.com by mail.g2switchworks.com; 08 Aug 2006 16:21:39 -0500 Subject: Re: Getting rid of postgres output From: Scott Marlowe To: Nicola Mauri Cc: pgsql-admin@postgresql.org In-Reply-To: References: Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1155072098.20252.63.camel@state.g2switchworks.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Tue, 08 Aug 2006 16:21:39 -0500 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=SPF_PASS, UNPARSEABLE_RELAY X-Spam-Level: X-Archive-Number: 200608/98 X-Sequence-Number: 22642 On Mon, 2006-08-07 at 09:00, 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. It'll just get worse as your database gets bigger. What's better is to check the output of the pg_dump / psql command. If you're using bash shell, you can do something like: if ! ( pg_dump --clean -U postgres test > /tmp/pgdump.sql ) ; then echo "failure in backup" | mail -s "backup failed" youremailhere; fi if ! ( psql test2 < /tmp/pgdump.sql ) ; then echo "restore failed" | mail -s "restore failed" youremailhere; fi or something like that. you can save the std out like the other poster pointed out as well.