Re: mail alert - Mailing list pgsql-sql

From Denis BUCHER
Subject Re: mail alert
Date
Msg-id 4A81F244.9070402@hsolutions.ch
Whole thread Raw
In response to mail alert  (Jan Verheyden <jan.verheyden@uz.kuleuven.ac.be>)
Responses Re: mail alert  (Rob Sargent <robjsargent@gmail.com>)
List pgsql-sql
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


pgsql-sql by date:

Previous
From: Steve Crawford
Date:
Subject: Re: Month/year between two dates
Next
From: Rob Sargent
Date:
Subject: Re: mail alert