Michael Monnerie wrote:
On Montag, 9. Juli 2007 Aaron Stone wrote:
The message is first inserted for the internal delivery user, then a
copy of the messages table entry is made for each recipient (it is
this way that we have some primitive one-physmessage-many-messages
support). When delivery is done, the message is removed from the
internal delivery user's mailbox. That's what activates your rule.
OK, I understand now, thanks.
As there's a problem with Pauls Trigger too, would this rule be correct?
CREATE RULE drop_messages_with_mailbox AS ON DELETE TO
dbmail_messages DO DELETE FROM dbmail_physmessage WHERE id =
OLD.physmessage_id AND id NOT IN (SELECT physmessage_id from
dbmail_messages);
The PostgreSQL documentation says that rules can be optimized and thus
much cheaper than triggers, so it could be good to use rules when
possible. What do you think about that?
I wasn't aware of that. Your rule looks ok to me.
--
________________________________________________________________
Paul Stevens paul at nfg.nl
NET FACILITIES GROUP GPG/PGP: 1024D/11F8CD31
The Netherlands________________________________http://www.nfg.nl
_______________________________________________
DBmail mailing list
[email protected]
https://mailman.fastxs.nl/mailman/listinfo/dbmail