pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Moray McConnachie <moray.mcconnachie@computing-services.oxford.ac.uk>
To: Oscar Serrano <oserra@fondos.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-interfaces@postgreSQL.org <pgsql-interfaces@postgresql.org>
Subject: Re: a trigger that sends an email
Date: Thu, 6 Apr 2000 17:06:49 +0100
Message-ID: <00ac01bf9fe2$1d4bdec0$760e01a3@oucs.ox.ac.uk> (raw)
References: <NDBBKNFDELOHICEHIMGGMELGCCAA.oserra@fondos.net>
	<26948.955032666@sss.pgh.pa.us>

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




view thread (5+ messages)  latest in thread

Message-ID: <00ac01bf9fe2$1d4bdec0$760e01a3@oucs.ox.ac.uk>
Permalink:  ../00ac01bf9fe2$1d4bdec0$760e01a3@oucs.ox.ac.uk/
Also on:    postgresql.org/message-id/00ac01bf9fe2$1d4bdec0$760e01a3@oucs.ox.ac.uk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: moray.mcconnachie@computing-services.oxford.ac.uk, oserra@fondos.net, tgl@sss.pgh.pa.us
  Subject: Re: a trigger that sends an email
  In-Reply-To: <00ac01bf9fe2$1d4bdec0$760e01a3@oucs.ox.ac.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox