Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id A382662DB8E for ; Thu, 13 Aug 2009 18:54:36 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 30567-05 for ; Thu, 13 Aug 2009 21:54:20 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from lists.commandprompt.com (host-159.commandprompt.net [207.173.203.159]) by mail.postgresql.org (Postfix) with ESMTP id CD61D63373A for ; Thu, 13 Aug 2009 18:54:25 -0300 (ADT) Received: from perhan.alvh.no-ip.org ([201.220.118.158]) (authenticated bits=0) by lists.commandprompt.com (8.13.8/8.13.8) with ESMTP id n7DLsN57028189 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 13 Aug 2009 14:54:26 -0700 Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 308AFD41A4; Thu, 13 Aug 2009 17:54:20 -0400 (CLT) Date: Thu, 13 Aug 2009 17:54:20 -0400 From: Alvaro Herrera To: Jasen Betts Cc: pgsql-sql@postgresql.org Subject: Re: mail alert Message-ID: <20090813215420.GU5909@alvh.no-ip.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (lists.commandprompt.com [207.173.203.159]); Thu, 13 Aug 2009 14:54:26 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.904 tagged_above=-10 required=5 tests=AWL=0.695, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200908/70 X-Sequence-Number: 32979 Jasen Betts wrote: > On 2009-08-12, Jan Verheyden wrote: > > --_000_E30C7040DE22624185BAD4093190B54437BE5DB4A9EX2007MBX2uzk_ > > Content-Type: text/plain; charset="us-ascii" > > Content-Transfer-Encoding: quoted-printable > > > > It's on Windows > > > > I'd go with notify and a listener written in C using c-client to send > emails, but only because I've used those before. I wouldn't write it in C but rather Perl or Python, but whatever suits your fancy should work (Visual Basic anyone?). The advantages to using a listener program instead of doing it in a trigger or something like that are: - transaction semantics are kept; you don't send an email only to find out your transaction has been rolled back for whatever reason, and then send a second email when the transaction is replayed - you don't block the database system just because your mail server is down - the email can be sent on whatever schedule fits the listener program - the listener client can run elsewhere, not only in the database server - any further external processing can take place at that time, without bothering the database server - other stuff I don't recall ATM -- Alvaro Herrera http://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support