Skip site navigation (1) Skip section navigation (2)

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

From: Nicholas Allen <Allen(dot)Nicholas(at)lycos(dot)co(dot)uk>
To: pgsql-novice(at)postgresql(dot)org
Subject: How to send an email when data is inserted into a table
Date: 2003-05-22 15:41:43
Message-ID: 200305221741.43808.Allen.Nicholas@lycos.co.uk (view raw or flat)
Thread:
Lists: pgsql-novice
Hi,

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?

Thanks in advance for any help,

Nicholas Allen.



Responses

pgsql-novice by date

Next:From: Renê SalomãoDate: 2003-05-22 16:38:38
Subject: Re: Installing PlPerl
Previous:From: Oliver ElphickDate: 2003-05-22 15:03:54
Subject: Re: timestamp data type?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group