Re: How to send an email when data is inserted into a table

From: "A(dot)Bhuvaneswaran" <bhuvan(at)symonds(dot)net>
To: Nicholas Allen <Allen(dot)Nicholas(at)lycos(dot)co(dot)uk>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: How to send an email when data is inserted into a table
Date: 2003-05-23 04:39:51
Message-ID: Pine.LNX.4.44.0305231005090.1006-100000@Bhuvan.bksys.co.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

> I have a table which stores bugs which can be submitted by users of our client
> program. I would like a way that when a new bug is inserted an email is sent
> to the developers informing them of this.
>
> I tried using a python trigger function to execute sendmail and pipe SMTP
> headers to it but the problem seems to be that the python functions are
> interpretted in a restrictive environment and don't allow access to local
> resources (files /processes etc). When I execute the python function outside
> of postgres it works fine but not when used as a trigger functions.
>
> I know I can do it by writing a C function but I would rather not use C if
> possible in the case. Python would be easier to maintain.
>
> Any ideas? Do I have to use C or is there a way to do this from pyhton?

Try, http://sourceforge.org/projects/pgmail/.

pgMail is a small TCL based script that you can store within any
PostgreSQL database. Once it is stored there, you can create any number of
specialized procedures to send email from directly within PostgreSQL. i.e.
emailing a customer when product ships

regards,
bhuvaneswaran

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Gerard TOURRES 2003-05-23 07:46:14
Previous Message Edwin New 2003-05-23 03:12:38 Problem on Cygwin