Re: a primer on trigger? - Mailing list pgsql-general

From Joel Burton
Subject Re: a primer on trigger?
Date
Msg-id Pine.LNX.4.21.0105041505480.30777-100000@olympus.scw.org
Whole thread Raw
In response to a primer on trigger?  (newsreader@mediaone.net)
Responses Re: a primer on trigger?  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-general
On Fri, 4 May 2001, Stephan Szabo wrote:

> > Can this be done? Is this terrible design? Is there any other reasonable
> > way to handle things like this?
>
> Probably could be done, but the question would be what happens if the
> TRANSACTION_AFTER raises an error condition for whatever reason?  You
> can't go back and un-commit the transaction.
>
> For that case above, you'd probably be better off having something in cron
> or whatever looking at your email-to-send table since it'll get only those
> things that have already committed.  You could put all the logic in a
> function on the server still.

Yep, you wouldn't be able to raise a meaningful error at this point.
Comes with the territory.

Cron job scanning a table would work, and is easy to set up.
I have a personal history of moving things like databases, and not always
moving cron jobs with them. It's nice to have solutions stay somewhat
contained.

--
Joel Burton   <jburton@scw.org>
Director of Information Systems, Support Center of Washington


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Re: a primer on trigger?
Next
From: "Othman Laraki"
Date:
Subject: RE: DB Getting Slower and Slower and Slower....