Re: a trigger that sends an email - Mailing list pgsql-interfaces

From Moray McConnachie
Subject Re: a trigger that sends an email
Date
Msg-id 00ac01bf9fe2$1d4bdec0$760e01a3@oucs.ox.ac.uk
Whole thread Raw
In response to RE: a trigger that sends an email + returning multiple records  ("Oscar Serrano" <oserra@fondos.net>)
Responses Re: a trigger that sends an email  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-interfaces
----- Original Message -----
From: "Tom Lane" <tgl@sss.pgh.pa.us>
To: "Oscar Serrano" <oserra@fondos.net>
Cc: "pgsql-interfaces@postgreSQL.org" <pgsql-interfaces@postgresql.org>
Sent: Thursday, April 06, 2000 3:51 PM
Subject: Re: [INTERFACES] a trigger that sends an email


> "Oscar Serrano" <oserra@fondos.net> writes:
> >>>> I thing I need to create a trigger. And I thing I need to create a
> >>>> function that sends an email.
> >>>> Is it possible?
> >>>> May I do the function that sends the email in Perl?
>
> I don't think you can do this directly from a trigger, unless you want
> to add the mail-sending function as a C extension to the backend.
> You'll run into security restrictions.  All of the higher-level trigger
> programming languages we offer are "trusted", which means you can't do
> anything that would affect files or programs outside the database.
> Sending email is right out.

Could one do a rule that used a dummy function, where the function called
the Perl routine which generates the email?

CREATE RULE emailer AS ON INSERT TO new_accounts   DO SELECT new_account_email_function(NEW.emailaddress);

or something like that? Or is this subject to the same restrictions?

M.



pgsql-interfaces by date:

Previous
From: Richard
Date:
Subject: Re: a trigger that sends an email + returning multiple records
Next
From: Tom Lane
Date:
Subject: Re: a trigger that sends an email