Re: Plperlu and sending emails, is it safe? - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: Plperlu and sending emails, is it safe?
Date
Msg-id 20040628172903.GA2652@dcc.uchile.cl
Whole thread Raw
In response to Re: Plperlu and sending emails, is it safe?  (Thomas Hallgren <thhal@mailblocks.com>)
Responses Re: Plperlu and sending emails, is it safe?  (Thomas Hallgren <thhal@mailblocks.com>)
List 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


pgsql-general by date:

Previous
From: "Scrappy"
Date:
Subject: Re: Text message
Next
From: Együd Csaba
Date:
Subject: Re: Performance problem on RH7.1