Skip site navigation (1) Skip section navigation (2)

Re: Plperlu and sending emails, is it safe?

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Thomas Hallgren <thhal(at)mailblocks(dot)com>
Cc: pgsql-general(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Plperlu and sending emails, is it safe?
Date: 2004-06-28 17:29:03
Message-ID: 20040628172903.GA2652@dcc.uchile.cl (view raw or flat)
Thread:
Lists: pgsql-general
On Mon, Jun 28, 2004 at 05:32:55PM +0200, Thomas Hallgren wrote:
> Thomas Hallgren wrote:
> >I would like to make it possible to add a callback that's called just at 
> >the start of a transaction as well. Such callbacks would have the 
> >ability to generate an error and abort the transaction. Would such a 
> >patch be well received?
>
> Correction. Not "start of a transaction" but "just prior to commit"

You want to abort the transaction on the callback?  What for?  You could
have aborted it earlier.

Of course, in a function you could save the mails you are going to send
and register a callback for the actual send, or discard if the
transaction is going to abort.  But you have to be very careful not to
do cause errors during the sending of the mails ...

All in all, I think it's easier to do it with NOTIFY or a cron job.

-- 
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
Jude: I wish humans laid eggs
Ringlord: Why would you want humans to lay eggs?
Jude: So I can eat them


In response to

Responses

pgsql-general by date

Next:From: Együd CsabaDate: 2004-06-28 17:53:13
Subject: Re: Performance problem on RH7.1
Previous:From: Jan WieckDate: 2004-06-28 17:02:56
Subject: Slony-I Canada Day Release Candidate available

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group