dbTalk Databases Forums  

Novice email notification in update/insert/delete trigger

comp.databases.postgresql comp.databases.postgresql


Discuss Novice email notification in update/insert/delete trigger in the comp.databases.postgresql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
johan.nel@xsinet.co.za
 
Posts: n/a

Default Novice email notification in update/insert/delete trigger - 10-29-2008 , 04:08 AM






Hi all,

Some of my users have requested that I implement and email
notification system in an application. I can do it programatically,
however what if the applicable tables are updated directly in the
database.

Is it possible to activate the sending of an email notification inside
of triggers?

I have been given the IP address of an SMTP server that I can send the
email notification through.

TIA,

Johan Nel
Pretoria, South Africa.

Reply With Quote
  #2  
Old   
Andreas Kretschmer
 
Posts: n/a

Default Re: Novice email notification in update/insert/delete trigger - 10-29-2008 , 04:24 AM






begin johan.nel (AT) xsinet (DOT) co.za schrieb:
Quote:
Hi all,

Some of my users have requested that I implement and email
notification system in an application. I can do it programatically,
however what if the applicable tables are updated directly in the
database.

Is it possible to activate the sending of an email notification inside
of triggers?
Sure, you do that using an untrusted language for the trigger-function.
But the better way is using listen/notify-mechanism, described here:
http://www.postgresql.org/docs/8.3/i...ql-listen.html
http://www.postgresql.org/docs/8.3/i...ql-notify.html

Other way:
use a scheduler (CRON under UNIX) and check regular for new updated
records. For instance, with every update store the PK in an other table.
With CRON check this table, send the email and delete the record in the
table.


end
Andreas
--
Andreas Kretschmer
Linux - weil ich es mir wert bin!
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net


Reply With Quote
  #3  
Old   
Andreas Kretschmer
 
Posts: n/a

Default Re: Novice email notification in update/insert/delete trigger - 10-29-2008 , 04:24 AM



begin johan.nel (AT) xsinet (DOT) co.za schrieb:
Quote:
Hi all,

Some of my users have requested that I implement and email
notification system in an application. I can do it programatically,
however what if the applicable tables are updated directly in the
database.

Is it possible to activate the sending of an email notification inside
of triggers?
Sure, you do that using an untrusted language for the trigger-function.
But the better way is using listen/notify-mechanism, described here:
http://www.postgresql.org/docs/8.3/i...ql-listen.html
http://www.postgresql.org/docs/8.3/i...ql-notify.html

Other way:
use a scheduler (CRON under UNIX) and check regular for new updated
records. For instance, with every update store the PK in an other table.
With CRON check this table, send the email and delete the record in the
table.


end
Andreas
--
Andreas Kretschmer
Linux - weil ich es mir wert bin!
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net


Reply With Quote
  #4  
Old   
Andreas Kretschmer
 
Posts: n/a

Default Re: Novice email notification in update/insert/delete trigger - 10-29-2008 , 04:24 AM



begin johan.nel (AT) xsinet (DOT) co.za schrieb:
Quote:
Hi all,

Some of my users have requested that I implement and email
notification system in an application. I can do it programatically,
however what if the applicable tables are updated directly in the
database.

Is it possible to activate the sending of an email notification inside
of triggers?
Sure, you do that using an untrusted language for the trigger-function.
But the better way is using listen/notify-mechanism, described here:
http://www.postgresql.org/docs/8.3/i...ql-listen.html
http://www.postgresql.org/docs/8.3/i...ql-notify.html

Other way:
use a scheduler (CRON under UNIX) and check regular for new updated
records. For instance, with every update store the PK in an other table.
With CRON check this table, send the email and delete the record in the
table.


end
Andreas
--
Andreas Kretschmer
Linux - weil ich es mir wert bin!
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net


Reply With Quote
  #5  
Old   
Andreas Kretschmer
 
Posts: n/a

Default Re: Novice email notification in update/insert/delete trigger - 10-29-2008 , 04:24 AM



begin johan.nel (AT) xsinet (DOT) co.za schrieb:
Quote:
Hi all,

Some of my users have requested that I implement and email
notification system in an application. I can do it programatically,
however what if the applicable tables are updated directly in the
database.

Is it possible to activate the sending of an email notification inside
of triggers?
Sure, you do that using an untrusted language for the trigger-function.
But the better way is using listen/notify-mechanism, described here:
http://www.postgresql.org/docs/8.3/i...ql-listen.html
http://www.postgresql.org/docs/8.3/i...ql-notify.html

Other way:
use a scheduler (CRON under UNIX) and check regular for new updated
records. For instance, with every update store the PK in an other table.
With CRON check this table, send the email and delete the record in the
table.


end
Andreas
--
Andreas Kretschmer
Linux - weil ich es mir wert bin!
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net


Reply With Quote
  #6  
Old   
Andreas Kretschmer
 
Posts: n/a

Default Re: Novice email notification in update/insert/delete trigger - 10-29-2008 , 04:24 AM



begin johan.nel (AT) xsinet (DOT) co.za schrieb:
Quote:
Hi all,

Some of my users have requested that I implement and email
notification system in an application. I can do it programatically,
however what if the applicable tables are updated directly in the
database.

Is it possible to activate the sending of an email notification inside
of triggers?
Sure, you do that using an untrusted language for the trigger-function.
But the better way is using listen/notify-mechanism, described here:
http://www.postgresql.org/docs/8.3/i...ql-listen.html
http://www.postgresql.org/docs/8.3/i...ql-notify.html

Other way:
use a scheduler (CRON under UNIX) and check regular for new updated
records. For instance, with every update store the PK in an other table.
With CRON check this table, send the email and delete the record in the
table.


end
Andreas
--
Andreas Kretschmer
Linux - weil ich es mir wert bin!
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net


Reply With Quote
  #7  
Old   
Andreas Kretschmer
 
Posts: n/a

Default Re: Novice email notification in update/insert/delete trigger - 10-29-2008 , 04:24 AM



begin johan.nel (AT) xsinet (DOT) co.za schrieb:
Quote:
Hi all,

Some of my users have requested that I implement and email
notification system in an application. I can do it programatically,
however what if the applicable tables are updated directly in the
database.

Is it possible to activate the sending of an email notification inside
of triggers?
Sure, you do that using an untrusted language for the trigger-function.
But the better way is using listen/notify-mechanism, described here:
http://www.postgresql.org/docs/8.3/i...ql-listen.html
http://www.postgresql.org/docs/8.3/i...ql-notify.html

Other way:
use a scheduler (CRON under UNIX) and check regular for new updated
records. For instance, with every update store the PK in an other table.
With CRON check this table, send the email and delete the record in the
table.


end
Andreas
--
Andreas Kretschmer
Linux - weil ich es mir wert bin!
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net


Reply With Quote
  #8  
Old   
Andreas Kretschmer
 
Posts: n/a

Default Re: Novice email notification in update/insert/delete trigger - 10-29-2008 , 04:24 AM



begin johan.nel (AT) xsinet (DOT) co.za schrieb:
Quote:
Hi all,

Some of my users have requested that I implement and email
notification system in an application. I can do it programatically,
however what if the applicable tables are updated directly in the
database.

Is it possible to activate the sending of an email notification inside
of triggers?
Sure, you do that using an untrusted language for the trigger-function.
But the better way is using listen/notify-mechanism, described here:
http://www.postgresql.org/docs/8.3/i...ql-listen.html
http://www.postgresql.org/docs/8.3/i...ql-notify.html

Other way:
use a scheduler (CRON under UNIX) and check regular for new updated
records. For instance, with every update store the PK in an other table.
With CRON check this table, send the email and delete the record in the
table.


end
Andreas
--
Andreas Kretschmer
Linux - weil ich es mir wert bin!
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net


Reply With Quote
  #9  
Old   
Andreas Kretschmer
 
Posts: n/a

Default Re: Novice email notification in update/insert/delete trigger - 10-29-2008 , 04:24 AM



begin johan.nel (AT) xsinet (DOT) co.za schrieb:
Quote:
Hi all,

Some of my users have requested that I implement and email
notification system in an application. I can do it programatically,
however what if the applicable tables are updated directly in the
database.

Is it possible to activate the sending of an email notification inside
of triggers?
Sure, you do that using an untrusted language for the trigger-function.
But the better way is using listen/notify-mechanism, described here:
http://www.postgresql.org/docs/8.3/i...ql-listen.html
http://www.postgresql.org/docs/8.3/i...ql-notify.html

Other way:
use a scheduler (CRON under UNIX) and check regular for new updated
records. For instance, with every update store the PK in an other table.
With CRON check this table, send the email and delete the record in the
table.


end
Andreas
--
Andreas Kretschmer
Linux - weil ich es mir wert bin!
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net


Reply With Quote
  #10  
Old   
VORio PostgreSQL
 
Posts: n/a

Default Re: Novice email notification in update/insert/delete trigger - 10-29-2008 , 11:04 AM



Hi Johan.
How are you!?

You can Try pgmail contrib @ http://sourceforge.net/projects/pgmail/
pgmail are some functions in TCL that enable you to send email via
PostgreSQL.
I never used it but have good recomendations about.
Are you a Johan that use Visual Objects from CA/GrafXSoft?

Good luck and send me an email or back here if you need for more...

Best regards.

Lucio Chiessi
Rio de Janeiro - Brazil



On 29 out, 07:08, johan.... (AT) xsinet (DOT) co.za wrote:
Quote:
Hi all,

Some of my users have requested that I implement and email
notification system in an application. I can do it programatically,
however what if the applicable tables are updated directly in the
database.

Is it possible to activate the sending of an email notification inside
of triggers?

I have been given the IP address of an SMTP server that I can send the
email notification through.

TIA,

Johan Nel
Pretoria, South Africa.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.