Last modified: 2012-09-08 00:06:12 UTC
Trying to delete a page leads to the following message: Warning: pg_query() [function.pg-query]: Query failed: ERROR: update or delete on "page" violates foreign key constraint "recentchanges_rc_cur_id_fkey" on "recentchanges" DETAIL: Key (page_id)=(24) is still referenced from table "recentchanges". in /usr/share/mediawiki/includes/db/DatabasePostgres.php on line 580 Warning: pg_query() [function.pg-query]: Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block in /usr/share/mediawiki/includes/db/DatabasePostgres.php on line 580 I indeed have a constraint in the recentchanges table, which probably need to be corrected: ALTER TABLE mediawiki.recentchanges ADD CONSTRAINT recentchanges_rc_cur_id_fkey FOREIGN KEY (rc_cur_id) REFERENCES mediawiki.page (page_id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION;
In the meantime, I found this bug mentioned for Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=517237 The fix suggested there appears to work. I did the following (only changing the ON DELETE action): ALTER TABLE mediawiki.recentchanges DROP CONSTRAINT recentchanges_rc_cur_id_fkey; ALTER TABLE mediawiki.recentchanges ADD CONSTRAINT recentchanges_rc_cur_id_fkey FOREIGN KEY (rc_cur_id) REFERENCES mediawiki.page (page_id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE SET NULL;
The constraint was fixed in r15697, so the fix made it into 1.8. But it seems there is no update for it. Does anyone still has an old MediaWiki installation that needs to be updated to test?
This has been fixed in r15697.