Sim Zacks schrieb:
We are using mysql with dbmail 2.2.7_rc2 and I just noticed that we have
a number of orphan rows in dbmail_fromfield. (There are no matching rows
in dbmail_physmessage)
select count(*) from dbmail_fromfield a left join dbmail_physmessage b
on a.physmessage_id=b.id where b.id is null;

I noticed this because I am planning on migrating to postgresql and the
constraints on the table (which apparently don't exist in the MySQL
version) were violated.

There are also a number of rows (not the same number) in
dbmail_physmessage that are not in dbmail_fromfield, though it doesn't
violate a relationship, so I am paying less attention to that.

I just checked some other tables and I have a ton of records in
dbmail_messages that do not have related records in dbmail_mailboxes.

(select count(*) from dbmail_messages a left join dbmail_mailboxes b on
a.mailbox_idnr=b.mailbox_idnr where b.mailbox_idnr is null;)


As you say:
We have not used any of the maintenance functions yet, and have not done
any SQL level deletes on these tables.
Did you ever run "dbmail-util -c -t -u -p -d -y"?

This utility do following:
(from my log:)
Repairing DBMAIL messageblocks integrity...
Ok. Found [0] unconnected messageblks.

Repairing DBMAIL physmessage integrity...
Ok. Found [0] unconnected physmessages.

Repairing DBMAIL message integrity...
Ok. Found [0] unconnected messages.

Repairing DBMAIL mailbox integrity...
Ok. Found [0] unconnected mailboxes.

Repairing DBMAIL for NULL messages...
Ok. Found [0] NULL messages.

Deleting messages with DELETE status...
Ok. [203] messages deleted.

Setting DELETE status for deleted messages...
Ok. [1] messages set for deletion.
Re-calculating used quota for all users...
Ok. Used quota updated for all users.

Vacuuming and optimizing database...
Ok. Database cleaned up.

Maintenance done. No errors found.


Regards,
   Uwe
Can you thnk of a reason why this would happen? I noticed the
constraints in Postgresql are cascade delete. That means that it will
still allow these deletes but I won't have orphan records (or in other
words, will not know that records have been deleted)

Thank you
Sim
_______________________________________________
DBmail mailing list
[email protected]
https://mailman.fastxs.nl/mailman/listinfo/dbmail

_______________________________________________
DBmail mailing list
[email protected]
https://mailman.fastxs.nl/mailman/listinfo/dbmail

Reply via email to