pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@commandprompt.com>
To: Jasen Betts <jasen@xnet.co.nz>
Cc: pgsql-sql@postgresql.org
Subject: Re: mail alert
Date: Thu, 13 Aug 2009 17:54:20 -0400
Message-ID: <20090813215420.GU5909@alvh.no-ip.org> (raw)
In-Reply-To: <h6106l$h8t$2@reversiblemaps.ath.cx>
References: <E30C7040DE22624185BAD4093190B54437BE5DB49C@EX2007-MBX-2.uz.kuleuven.ac.be>
	<EC8A0653E149420D898593D05B1E07FF@ramasubramanian>
	<E30C7040DE22624185BAD4093190B54437BE5DB4A9@EX2007-MBX-2.uz.kuleuven.ac.be>
	<h6106l$h8t$2@reversiblemaps.ath.cx>

Jasen Betts wrote:
> On 2009-08-12, Jan Verheyden <jan.verheyden@uz.kuleuven.ac.be> 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



view thread (16+ messages)  latest in thread

Message-ID: <20090813215420.GU5909@alvh.no-ip.org>
Permalink:  ../20090813215420.GU5909@alvh.no-ip.org/
Also on:    postgresql.org/message-id/20090813215420.GU5909@alvh.no-ip.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: alvherre@commandprompt.com, jasen@xnet.co.nz
  Subject: Re: mail alert
  In-Reply-To: <20090813215420.GU5909@alvh.no-ip.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox