Extension talk:SpecialDeleteOldRevisions2

Does not work with Postgres
If the extension is used with a Postgres database as backend, the following error occurs:

A database error has occurred Query: SELECT rev_id FROM revision,page WHERE (rev_id NOT IN ( 10918, 10950, 10977, 6545, 7219, 5893, 6399, 1655, 10411, 1931, 2704, 7876, 7882, 7878, 7880, 6702, 6909, 6910, 6950, 6705 ) AND rev_timestamp <= '20100311999999') AND (rev_page = page_id AND page_title LIKE 'Z%') Function: Database::select Error: 1 ERROR: invalid input syntax for type timestamp with time zone: "20100311999999"

Obviously, '20100311999999' isn't a valid date. I assume MySQL is doing some magick behind the scenes so that it works nevertheless. Why is the '999999' appended anyway? Because just removing them seems to work fine.

Keep at least five or ten revisions, regardless of date
I would like to keep at least five or ten revisions per article. Regardless of how old the next-to-lat revision was. If Mr. Schmidt would add that function I would be grateful. Otherwise, I might take a look at how 'maxdate' is handled and add a 'maxcount' for this purpose. Thanks for making this extension. --John S. Peterson 16:25, 7 February 2010 (UTC)

Thanks
Great job. Thanks! It works fine on Mediawiki 1.14.0 with MySql 5.0.67-0ubuntu6 Enzo

Deleting only archived revisions
Is there any possibility of modifying this to allow deleting only deleted revisions, that is, the "archived" revisions that can be selected in the current version of the extension?

There are some times when it is helpful to keep a history, but when one would like to delete garbage revisions (e.g., revisions made during testing) and keep the size of the database down. Currently, first, I delete the page, then restore the revisions I want to keep, then I run the following MySQL queries, but they don't seem to get everything:

To list the deleted revisions:

SELECT `tblprefix_archive`.`ar_text_id`, `tblprefix_archive`.`ar_title`,`tblprefix_text`.`old_id`,`tblprefix_text`.`old_text`, `tblprefix_revision`.`rev_id` FROM tblprefix_archive, tblprefix_text, tblprefix_revision WHERE ((`tblprefix_text`.`old_id`=`tblprefix_archive`.`ar_text_id`) AND (`tblprefix_text`.`old_id`=`tblprefix_revision`.`rev_id`)) ORDER BY `tblprefix_text`.`old_id` DESC

To delete them:

DELETE FROM tblprefix_archive, tblprefix_revision, tblprefix_text USING tblprefix_archive, tblprefix_revision, tblprefix_text WHERE WHERE ((`tblprefix_archive`.`ar_text_id` >0) AND (`tblprefix_text`.`old_id`=`tblprefix_archive`.`ar_text_id`) AND (`tblprefix_text`.`old_id`=`tblprefix_revision`.`rev_id`))

Is this a reasonable approach that gets all the old text (and all references to it) out of the database?

If you don't have time to change the extension, I'd appreciate any tips about how I could modify the extension myself (or at least fix my SQL queries), but I'm more of a "front-end" user - I don't know much about PHP or MySQL.

Thanks! --Fungiblename 19:51, 2 February 2009 (UTC)
 * There is a maintenance script available for this, see MediaWiki maintenance - removing deleted revisions. Patheticcockroach 15:05, 28 July 2009 (UTC)


 * If you still need this, I can add an option. Jehy 03:02, 1 December 2009 (UTC)

Strange error message
Hello, I get an error message, when trying to use this tool. the error message is partially in german language:

Es ist ein Datenbankfehler aufgetreten. Der Grund kann ein Timeout sein, der Ausfall eines Servers oder auch ein Programmierfehler. Die letzte Datenbankabfrage lautete:

(SQL-Abfrage versteckt)

aus der Funktion „“. MySQL meldete den Fehler „1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ', , , , , , , , , , , , , , , , , , , , , , , , , , , 139, 140, 143, 144, 145, ' at line 1 (localhost)“.

Is it possible that this extension does not work for MySQL 5 and above? Or what is wrong?

Thanks for help! -- Roy, 12:05, 22 March 2009 (GMT)
 * Extension works fine for MySQL 5, we need to take a closer look at your problem. Jehy 03:02, 1 December 2009 (UTC)

How to shrink database?
After deleting old revisions from a page, a message is displayed:

Remember to shrink your database after deleting many articles.

How do you shrink the database?

Applicationswhisperer 22:04, 4 September 2009 (UTC)
 * I think this is what you need to do:
 * If using MySQL you need to optimize the tables afterwards, you can do that with phpMyAdmin.
 * --Choshi 00:00, 13 September 2009 (UTC)

Problems downloading extension
It appears as though Jehy's site is gone. Is there a backup site with the code?


 * Maybe its a temp downtime. --Choshi 15:52, 13 September 2009 (UTC)


 * Yeah, sorry for this, all ok now. Thanks for providing backup link. Jehy 03:02, 1 December 2009 (UTC)

pruning revisions using a "pruning date"
Hello,

I am very interested in a single parameter for your extension, a single date to prune (delete) the revision table before that date. I will pay a bounty (give you a donation) for such a modification (stable program version needed). --Wikinaut 22:47, 22 December 2009 (UTC)
 * No problem, just contact me (see in my profile, how) Jehy 13:10, 27 December 2009 (UTC)

Compatibility issue with SemanticForms 1.8.8
See: this page for details. "HTMLForm.php" is deprecated and should be removed from the bundle. Alvinos 13:26, 8 March 2010 (UTC)

broken in latest svn of wiki
Fatal error: Call to undefined function wfElement in /web/htdocs/www.www0.org/home/wiki/extensions/SpecialDeleteOldRevisions2/SpecialDeleteOldRevisions2.php on line 396 --212.54.219.23 11:17, 14 March 2010 (UTC)