If you use Aperture and have installed Leopard, you will have to set the frequency of Time Machine backups to "manual". Apple released a TechNote describing the bug and how to bypass it while waiting for a fix:
Issue or symptom
Running Time Machine backup or restore operations while Aperture is running may lead to inconsistencies in the Aperture database.
Products affected
Aperture
Mac OS X 10.5 Leopard
Solution
If you use Time Machine with Leopard, be sure to set your computer up so that Time Machine only does manual backups. Avoid performing either backups or restores while Aperture is running.
[translation by Linathael]