Please log into your database with psql on the command line, and post
back the output of '\d dbmail_datefield'. I suspect that you might be
missing the "ON UPDATE CASCADE ON DELETE CASCADE" part of the foreign
key definition.

Aaron

On Wed, 2007-05-09 at 14:22 +0200, Andrea Brancatelli wrote:
> Some users have been reporting errors with their mail since a while,
> today I sneeked a look and found this:
> 
>  
> 
> May  9 14:08:31 carota dbmail/smtp[363]: Error [Cannot delete or
> update a parent row: a foreign key constraint fails
> (`dbmail`.`dbmail_datefield`, CONSTRAINT `dbmail_datefield_ibfk_1`
> FOREIGN KEY (`physmessage_id`) REFERENCES `dbmail_physmessage`
> (`id`))] [DELETE FROM dbmail_physmessage WHERE id = 147004]
> 
> May  9 14:08:31 carota dbmail/smtp[363]: Error failed to delete
> temporary message [243478]
> 
>  
> 
> In the log….
> 
>  
> 
> I run dbmail-util –a –y (that is running every night anyhow) and it
> gave me this:
> 
>  
> 
> Opening connection to database...
> 
> Opening connection to authentication...
> 
> Ok. Connected.
> 
>  
> 
> Repairing DBMAIL messageblocks integrity...
> 
> Ok. Found [0] unconnected messageblks.
> 
>  
> 
> Checking DBMAIL message integrity...
> 
> Ok. Found [0] unconnected messages.
> 
>  
> 
> Checking DBMAIL mailbox integrity...
> 
> Ok. Found [0] unconnected mailboxes.
> 
>  
> 
> Repairing DBMAIL for NULL messages...
> 
> Ok. Found [0] NULL messages.
> 
>  
> 
> Checking DBMAIL for NULL physmessages...
> 
> Ok. Found [0] physmessages without messageblocks.
> 
>  
> 
> Deleting messages with DELETE status...
> 
> Error [Cannot delete or update a parent row: a foreign key constraint
> fails (`dbmail`.`dbmail_datefield`, CONSTRAINT
> `dbmail_datefield_ibfk_1` FOREIGN KEY (`physmessage_id`) REFERENCES
> `dbmail_physmessage` (`id`))] [DELETE FROM dbmail_physmessage WHERE id
> = 2774]
> 
> Error error deleting message
> 
> Failed. An error occured. Please check log.
> 
>  
> 
> Repairing DBMAIL for rfcsize field...
> 
> Ok. Found [0] missing rfcsize values.
> 
>  
> 
> Repairing DBMAIL for incorrect is_header flags...
> 
> Ok. Found [0] incorrect is_header flags.
> 
>  
> 
> Repairing DBMAIL for cached envelopes...
> 
> Ok. Found [0] missing envelope values.
> 
>  
> 
> Repairing DBMAIL for cached header values...
> 
> Ok. Found [0] un-cached physmessages.
> 
>  
> 
> Setting DELETE status for deleted messages...
> 
> Ok. [236] 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.
> 
>  
> 
> What’s happening?
> 
>  
> 
> How can I fix this?
> 
>  
> 
> Thanks ;)
> 
>  
> 
>  
> 
>  
> 
> 
> _______________________________________________
> 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