|
|
|
|
|
|
| Author |
Message |
CSN *nix forums addict
Joined: 01 Mar 2005
Posts: 91
|
Posted: Tue Mar 01, 2005 10:17 pm Post subject:
Trigger email?
|
|
|
Is it possible to setup a trigger so that every time a
certain field is changed, an email is sent? Using
pl/pgsql.
Thanks,
CSN
__________________________________
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings |
|
| Back to top |
|
 |
Christopher Browne *nix forums beginner
Joined: 01 Mar 2005
Posts: 14
|
Posted: Tue Mar 01, 2005 10:23 pm Post subject:
Re: Trigger email?
|
|
|
cool_screen_name90001@yahoo.com (CSN) writes:
| Quote: | Is it possible to setup a trigger so that every time a
certain field is changed, an email is sent? Using
pl/pgsql.
|
Something _like_ that is possible.
What I would do instead is for the trigger to cause a record to be put
into a table that might be called something like "submit_email".
An asynchronous process (that might look for NOTIFY requests!) would
then rummage thru submit_email to find messages it needs to send.
That allows you to keep this sort of thing under some degree of
control.
- It means you're not concurrently spawning 157 MTA connections; the
"mail manager" only needs to open _one_ connection
- It means you have some ability to manage how much mail gets sent out
at once.
--
let name="cbbrowne" and tld="cbbrowne.com" in String.concat "@" [name;tld];;
http://www.ntlug.org/~cbbrowne/linuxxian.html
A VAX is virtually a computer, but not quite.
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org |
|
| Back to top |
|
 |
Jonathan Hedstrom *nix forums beginner
Joined: 01 Mar 2005
Posts: 1
|
Posted: Tue Mar 01, 2005 11:53 pm Post subject:
Re: Trigger email?
|
|
|
Christopher Browne wrote:
| Quote: | cool_screen_name90001@yahoo.com (CSN) writes:
Is it possible to setup a trigger so that every time a
certain field is changed, an email is sent? Using
pl/pgsql.
Something _like_ that is possible.
you can also do it directly with a trigger if you prefer: |
CREATE TRIGGER alert_insert
AFTER INSERT OR UPDATE ON alert FOR EACH ROW
EXECUTE PROCEDURE alert_notify();
Where the alert_notify() function would then call pgmail() with a
meaningful subject and body etc -- see below
| Quote: | What I would do instead is for the trigger to cause a record to be put
into a table that might be called something like "submit_email".
An asynchronous process (that might look for NOTIFY requests!) would
then rummage thru submit_email to find messages it needs to send.
at which point you could then use pgmail() to send the email |
http://sourceforge.net/projects/pgmail/ |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Fri Jan 09, 2009 3:26 am | All times are GMT
|
|
Credit Counseling | Credit Reports | Myspace Layouts | Agencia de viagens | Vanzari Auto
|
|
Copyright © 2004-2005 DeniX Solutions SRL
|
|
|
|
Other DeniX Solutions sites:
Unix/Linux blog |
electronics forum |
medicine forum |
science forum |
|
|
Privacy Policy
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|