post2cat doesn't exist after upgrading WordPress
Note to help anyone else who has the same problem!
If you are a “little behind” the times when you upgrade you WordPress installation, you may see errors like this:
WordPress database error: [Table ‘xxx.wp_post2cat’ doesn’t exist]
SELECT cat_ID AS ID, MAX(post_modified) AS last_mod FROM
wp_post2catpc ON p.ID = pc.post_id
wp_categoriesc ON pc.category_id = c.cat_ID
WHERE post_status = ‘publish’ GROUP BY cat_
This is because the tables used for storing categories has been changed and the old ones (wp_post2cat and friends) have been deleted and you have some old code in a plugin or your theme that uses it.
In my case it was this Google Sitemap Generator Plugin which was updated back when WordPress 2.1 was released, so the fault is clearly all mine! One thing that was interesting is that the plugin page within the WordPress admin system didn’t tell me that I needed to upgrade that plugin, but it did tell me about others.