pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re: a trigger that sends an email + returning multiple records
4+ messages / 3 participants
[nested] [flat]

* Re: a trigger that sends an email + returning multiple records
@ 2000-04-06 11:09  Moray McConnachie <moray.mcconnachie@computing-services.oxford.ac.uk>
  0 siblings, 1 reply; 4+ messages in thread

From: Moray McConnachie @ 2000-04-06 11:09 UTC (permalink / raw)
  To: Oscar Serrano <oserra@fondos.net>; pgsql-interfaces

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




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* RE: a trigger that sends an email + returning multiple records
@ 2000-04-06 11:23  Oscar Serrano <oserra@fondos.net>
  parent: Moray McConnachie <moray.mcconnachie@computing-services.oxford.ac.uk>
  0 siblings, 1 reply; 4+ messages in thread

From: Oscar Serrano @ 2000-04-06 11:23 UTC (permalink / raw)
  To: Moray McConnachie <moray.mcconnachie@computing-services.oxford.ac.uk>; pgsql-interfaces



> -----Mensaje original-----
> De: Moray McConnachie
> [mailto:moray.mcconnachie@computing-services.oxford.ac.uk]
> Enviado el: jueves, 06 de abril de 2000 13:09
> Para: Oscar Serrano; pgsql-interfaces@postgreSQL.org
> Asunto: Re: [INTERFACES] a trigger that sends an email + returning
> multiple records
>
>
> 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.

This sounds really interesting. I will have to try it.

But I don't really undertand the rest of the email. I do not need
a function that returns any record. It just must open the sendmail and
send an email. And it must be done each time a record is inserted on
a table.

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




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: a trigger that sends an email + returning multiple records
@ 2000-04-06 13:51  Moray McConnachie <moray.mcconnachie@computing-services.oxford.ac.uk>
  parent: Oscar Serrano <oserra@fondos.net>
  0 siblings, 1 reply; 4+ messages in thread

From: Moray McConnachie @ 2000-04-06 13:51 UTC (permalink / raw)
  To: Oscar Serrano <oserra@fondos.net>; pgsql-interfaces

----- Original Message -----
From: "Oscar Serrano" <oserra@fondos.net>
To: "Moray McConnachie" <moray.mcconnachie@computing-services.oxford.ac.uk>;
"pgsql-interfaces@postgreSQL.org" <pgsql-interfaces@postgresql.org>
Sent: Thursday, April 06, 2000 12:23 PM
Subject: RE: [INTERFACES] a trigger that sends an email + returning multiple
records



> This sounds really interesting. I will have to try it.
>
> But I don't really undertand the rest of the email. I do not need
> a function that returns any record. It just must open the sendmail and
> send an email. And it must be done each time a record is inserted on
> a table.

Sorry, the rest of the email was off-topic, but related to other discussions
that people have been having on the pgsql lists in the recent past.

"Incidentally" tends to imply that.

Yours,
Moray
----------------------------------------------------------------
Moray.McConnachie@computing-services.oxford.ac.uk




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: a trigger that sends an email + returning multiple records
@ 2000-04-06 15:29  Richard <blackw@sfu.ca>
  parent: Moray McConnachie <moray.mcconnachie@computing-services.oxford.ac.uk>
  0 siblings, 0 replies; 4+ messages in thread

From: Richard @ 2000-04-06 15:29 UTC (permalink / raw)
  To: pgsql-interfaces

Moray McConnachie wrote:
[snip]
> > But I don't really undertand the rest of the email. I do not need
> > a function that returns any record. It just must open the sendmail and
> > send an email. And it must be done each time a record is inserted on
> > a table.
> 
> Sorry, the rest of the email was off-topic, but related to other discussions
> that people have been having on the pgsql lists in the recent past.
> 
> "Incidentally" tends to imply that.
> 
> Yours,
> Moray
> ----------------------------------------------------------------
> Moray.McConnachie@computing-services.oxford.ac.uk

I've just had a little chin-wag with Mr. Webster, and we both have come
to the conclusion that "incidentally" does not in fact imply "off
topic".  We believe it means something more along the lines of
"subordinate" or "non-essential" to the topic under discussion. 
Incidentally, Mr. Merriam is vacationing in the Bahamas and could not be
reached for comment.  ;)

Cheers,
Richard



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2000-04-06 15:29 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-04-06 11:09 Re: a trigger that sends an email + returning multiple records Moray McConnachie <moray.mcconnachie@computing-services.oxford.ac.uk>
2000-04-06 11:23 ` Oscar Serrano <oserra@fondos.net>
2000-04-06 13:51   ` Moray McConnachie <moray.mcconnachie@computing-services.oxford.ac.uk>
2000-04-06 15:29     ` Richard <blackw@sfu.ca>

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