----- 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.