Re: a trigger that sends an email

From: "Moray McConnachie" <moray(dot)mcconnachie(at)computing-services(dot)oxford(dot)ac(dot)uk>
To: "Oscar Serrano" <oserra(at)fondos(dot)net>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-interfaces(at)postgreSQL(dot)org" <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: a trigger that sends an email
Date: 2000-04-06 16:06:49
Message-ID: 00ac01bf9fe2$1d4bdec0$760e01a3@oucs.ox.ac.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

----- Original Message -----
From: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Oscar Serrano" <oserra(at)fondos(dot)net>
Cc: "pgsql-interfaces(at)postgreSQL(dot)org" <pgsql-interfaces(at)postgresql(dot)org>
Sent: Thursday, April 06, 2000 3:51 PM
Subject: Re: [INTERFACES] a trigger that sends an email

> "Oscar Serrano" <oserra(at)fondos(dot)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.

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Tom Lane 2000-04-06 17:52:44 Re: a trigger that sends an email
Previous Message Richard 2000-04-06 15:29:44 Re: a trigger that sends an email + returning multiple records