title: A row is missing from one of my tables in my Django site. Where did it go?
body: <p>A row is missing from one of my tables in my Django site.</p>
  <ol>
  <li><p>There is absolutely nothing in django_admin_log table mentioning that it was deleted. There were other deletions performed on that day and they were saved. Also, I checked Django's admin code and it looks like it tries logging the deletion first, so even if the deletion was made in a non-transaction manner, in the worst case I'd have log entry and a non-deleted record.</p>
  </li>
  <li><p>There are no logs in the web log, neither nginx nor my web app log, that suggest that it was removed by Django-admin. There are logs of another deletion made on that day, so I guess deletions were logged.</p>
  </li>
  <li><p>The database in question is PostgreSQL. I've just read about <code>pg_dirtyread</code>, unfortunately, I've just vacuumed the database a moment ago.</p>
  </li>
  </ol>
  <p>My takes:</p>
  <ol>
  <li><p>Delete query typed from command-line utility - nope, nobody was logged-in on that day.</p>
  </li>
  <li><p>Hacker? Come on, why would a hacker delete a single record from a table of a custom CMS-like software?</p>
  </li>
  <li><p>Hardware fault? Memory problems would manifest in other, random ways. Disk problems - probably too. I have found an anecdotal mention of a record missing from an index in PostgreSQL because of overheating CPU, which would also give other issues, I guess. This is too narrow issue to be causes by hardware faults, I think. On the other hand, the record was &quot;cleanly&quot; dropped, taking some other records with it, as per CASCADE rules in the database.</p>
  </li>
  </ol>
  <p>Do you have any ideas on how that single row could be gone missing?</p>
  <p>Any suggestions on how do I prevent such issues from happening again? Log all DELETE queries in PostgreSQL? Or just all queries? Log all shell commands/access? Log everything?</p>