X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 6C9279FA29F for ; Thu, 11 May 2006 06:07:48 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 85178-04 for ; Thu, 11 May 2006 06:07:44 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from fep02.ttnet.net.tr (mail.ttnet.net.tr [212.175.13.129]) by postgresql.org (Postfix) with ESMTP id 155DC9FA15C for ; Thu, 11 May 2006 06:07:43 -0300 (ADT) Received: from alamut ([85.97.183.240]) by fep02.ttnet.net.tr with ESMTP id <20060511090742.OSEC1367.fep02.ttnet.net.tr@alamut>; Thu, 11 May 2006 12:07:42 +0300 Date: Thu, 11 May 2006 12:05:24 +0300 From: Volkan YAZICI To: Vadim Pestovnikov Cc: pgsql-admin@postgresql.org Subject: Re: Python os.system module handle errors Message-ID: <20060511090524.GB223@alamut> References: <1B6B036445BFC94490C87AF12F102AD3144DC4@tofn-svr-exc-01.yak.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1B6B036445BFC94490C87AF12F102AD3144DC4@tofn-svr-exc-01.yak.ca> User-Agent: Mutt/1.4.2.1i X-NAI-Spam-Rules: 1 Rules triggered BAYES_00=-2.5 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/138 X-Sequence-Number: 21670 On May 04 04:50, Vadim Pestovnikov wrote: > When I create a database dump in python script and if there are some > errors (user_name is not correct, db_name doesn't exist or something > else) I need to send e-mail notification to admin. How can I handle > these errors? I don't think this has anything to do with PostgreSQL. IMHO you should start with reading documentation of Python os module (especially OSError exceptions part) and consult to a python related mailing list. Regards.