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: pgsql-interfaces@postgreSQL.org <pgsql-interfaces@postgresql.org>
Subject: Re: a trigger that sends an email + returning multiple records
Date: Thu, 6 Apr 2000 12:09:11 +0100
Message-ID: <00c101bf9fb8$89107820$760e01a3@oucs.ox.ac.uk> (raw)
References: <NDBBKNFDELOHICEHIMGGCELECCAA.oserra@fondos.net>

7.0 provides support for calling Perl functions, although I haven't had time
to experiment with it. In beta4 (not sure about earlier betas), it can be
found in the src/interfaces/perl5 directory, with examples in the eg
subdirectory beneath that...
Looks pretty good, although I guess it still can't return multiple records.

Incidentally, I've just thought of a work around for not being able to
return multiple records, although I'm not sure how exactly it would work.
Could one have a function that would create a table with (e.g.) a random
time-based name, fill it with the desired records, and return the name of
the table as the result of the argument?

Could one do for example, something like

SELECT searchid FROM searchfunction('criteria1','criteria2','criteria3')

or is that going to be rejected because you can't have functions returning
tablenames?

Haven't got time to look at any of this :-<
Yours,
Moray
----------------------------------------------------------------
Moray.McConnachie@computing-services.oxford.ac.uk
----- Original Message -----
From: "Oscar Serrano" <oserra@fondos.net>
To: "pgsql-interfaces@postgreSQL.org" <pgsql-interfaces@postgresql.org>
Sent: Thursday, April 06, 2000 9:50 AM
Subject: [INTERFACES] a trigger that sends an email


> Hi:
>
> I need to do something special.
> I need that when a new record is inserted in one of my tables, the system
> sends an email.
> 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?
>
> Any idea?
>
> Thank you very much.
>
>
>




view thread (4+ messages)  latest in thread

Message-ID: <00c101bf9fb8$89107820$760e01a3@oucs.ox.ac.uk>
Permalink:  ../00c101bf9fb8$89107820$760e01a3@oucs.ox.ac.uk/
Also on:    postgresql.org/message-id/00c101bf9fb8$89107820$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
  Subject: Re: a trigger that sends an email + returning multiple records
  In-Reply-To: <00c101bf9fb8$89107820$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