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? mfg zmi -- // Michael Monnerie, Ing.BSc ----- http://it-management.at // Tel: 0676/846 914 666 .network.your.ideas. // PGP Key: "curl -s http://zmi.at/zmi.asc | gpg --import" // Fingerprint: EA39 8918 EDFF 0A68 ACFB 11B7 BA2D 060F 1C6F E6B0 // Keyserver: www.keyserver.net Key-ID: 1C6FE6B0
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ DBmail mailing list [email protected] https://mailman.fastxs.nl/mailman/listinfo/dbmail
