Re: Question on triggers and plpgsql - Mailing list pgsql-sql

From Richard Huxton
Subject Re: Question on triggers and plpgsql
Date
Msg-id 4256AB11.6070206@archonet.com
Whole thread Raw
In response to Re: Question on triggers and plpgsql  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
Tom Lane wrote:
>  The hypothetical mail-sending process
> would presumably want to send mail and then delete the associated record
> from the table of pending mails ... so what if it fails after sending
> the mail and before committing the delete?
> 
> What this does do for you is replace the risk of phantom emails (mail
> sent but corresponding action inside the database never committed)
> with the risk of duplicate emails (mail-sender sends you another one
> after it restarts).  In most cases I think I'd prefer the latter.

You have this possibility anyway. If a mailserver thinks it has failed 
to forward the message, it will resend. There is always a small window 
where the receiving mailserver might actually have received the message 
without the acknowledgement being logged by the sender.

--  Richard Huxton  Archonet Ltd


pgsql-sql by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: Question on triggers and plpgsql
Next
From: Ragnar Hafstað
Date:
Subject: Re: getting count for a specific querry