On Montag, 10. September 2007 20:25 Paul J Stevens wrote:
> SELECT COUNT(*) FROM dbmail_physmessage WHERE id NOT IN
>         (SELECT physmessage_id FROM dbmail_messages)

I'm surprised because I didn't believe that there were that many 
unlinked physmessages, as I have a postgres rule that should prevent 
that from happening:

CREATE RULE drop_messages_with_mailbox AS ON DELETE TO dbmail_messages 
DO DELETE FROM dbmail_physmessage WHERE ((dbmail_physmessage.id = 
old.physmessage_id) AND (NOT (dbmail_physmessage.id IN (SELECT 
dbmail_messages.physmessage_id FROM db
mail_messages))));

There must be other places than dbmail_messages deleting that create an 
unlinked physmessage, or a bug in postgres?

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

Attachment: pgpsjfrHSXV9p.pgp
Description: PGP signature

_______________________________________________
DBmail mailing list
DBmail@dbmail.org
https://mailman.fastxs.nl/mailman/listinfo/dbmail

Reply via email to