From: Denis BUCHER <dbucherml@hsolutions.ch>
To: Jan Verheyden <jan.verheyden@uz.kuleuven.ac.be>
Cc: 'pgsql-sql@postgresql.org' <pgsql-sql@postgresql.org>
Subject: Re: mail alert
Date: Wed, 12 Aug 2009 00:35:48 +0200
Message-ID: <4A81F244.9070402@hsolutions.ch> (raw)
In-Reply-To: <E30C7040DE22624185BAD4093190B54437BE5DB49C@EX2007-MBX-2.uz.kuleuven.ac.be>
References: <E30C7040DE22624185BAD4093190B54437BE5DB49C@EX2007-MBX-2.uz.kuleuven.ac.be>
Hello,
Jan Verheyden a écrit :
> I was looking in what way it’s possible to alert via mail when some
> conditions are true in a database.
a) If the alert is not "very urgent" i.e. you can alter some minutes
later I would do it like this :
1. Create a function that returns what you need, most importantly if the
conditions are met
2. Create a script that does something like "SELECT * FROM function()..."
b) If the email should be sent immediately, you could create a perl
function in the database, launched by a TRIGGER and launching an
"external" script...
Therefore, first you have to know the requirements...
Denis
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: dbucherml@hsolutions.ch, jan.verheyden@uz.kuleuven.ac.be
Subject: Re: mail alert
In-Reply-To: <4A81F244.9070402@hsolutions.ch>
* 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