Thread:Project:Support desk/PostgreSQL and "LOCK IN SHARE MODE"

I am using MediaWiki 1.19.1; PHP 5.3.10-1ubuntu3.2 (apache2handler) and PostgreSQL 9.1.5.

After a while using the wiki an error showed up in one of our categories. Every-time we enter this one category we get the following error:

MediaWiki internal error.

Original exception: exception 'DBQueryError' with message 'A database error has occurred. Did you forget to run maintenance/update.php after upgrading? See: https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script Query: SELECT COUNT(*) AS pages,COUNT( (CASE WHEN page_namespace=14 THEN 1 ELSE NULL END) ) AS subcats,COUNT( (CASE WHEN page_namespace=6 THEN 1 ELSE NULL END) ) AS files FROM "categorylinks","page" WHERE cl_to = 'Verfahrensanweisungen' AND (page_id = cl_from) LIMIT 1 LOCK IN SHARE MODE Function: Category::refreshCounts Error: 1 ERROR: syntax error at or near "LOCK" LINE 1: ...nsanweisungen' AND (page_id = cl_from) LIMIT 1 LOCK IN SH... ^ ' in /var/www/mediawiki/includes/db/Database.php:918 Stack trace:
 * 1) 0 /var/www/mediawiki/includes/db/Database.php(885): DatabaseBase->reportQueryError('ERROR: syntax ...', 1, 'SELECT COUNT(*...', 'Category::refre...', false)
 * 2) 1 /var/www/mediawiki/includes/db/Database.php(1358): DatabaseBase->query('SELECT COUNT(*...', 'Category::refre...')
 * 3) 2 /var/www/mediawiki/includes/db/Database.php(1445): DatabaseBase->select(Array, Array, Array, 'Category::refre...', Array, Array)
 * 4) 3 /var/www/mediawiki/includes/Category.php(289): DatabaseBase->selectRow(Array, Array, Array, 'Category::refre...', 'LOCK IN SHARE M...')
 * 5) 4 /var/www/mediawiki/includes/CategoryViewer.php(670): Category->refreshCounts
 * 6) 5 /var/www/mediawiki/includes/CategoryViewer.php(379): CategoryViewer->getCountMessage(1, 2, 'article')
 * 7) 6 /var/www/mediawiki/includes/CategoryViewer.php(90): CategoryViewer->getPagesSection
 * 8) 7 /var/www/mediawiki/includes/CategoryPage.php(97): CategoryViewer->getHTML
 * 9) 8 /var/www/mediawiki/includes/CategoryPage.php(63): CategoryPage->closeShowCategory
 * 10) 9 /var/www/mediawiki/includes/actions/ViewAction.php(40): CategoryPage->view
 * 11) 10 /var/www/mediawiki/includes/Wiki.php(484): ViewAction->show
 * 12) 11 /var/www/mediawiki/includes/Wiki.php(278): MediaWiki->performAction(Object(CategoryTreeCategoryPage))
 * 13) 12 /var/www/mediawiki/includes/Wiki.php(593): MediaWiki->performRequest
 * 14) 13 /var/www/mediawiki/includes/Wiki.php(503): MediaWiki->main
 * 15) 14 /var/www/mediawiki/index.php(58): MediaWiki->run
 * 16) 15 {main}

Exception caught inside exception handler: exception 'DBUnexpectedError' with message 'SQL error: ERROR: current transaction is aborted, commands ignored until end of transaction block' in /var/www/mediawiki/includes/db/DatabasePostgres.php:313 Stack trace:
 * 1) 0 /var/www/mediawiki/includes/WatchedItem.php(45): DatabasePostgres->numRows(false)
 * 2) 1 /var/www/mediawiki/includes/User.php(2581): WatchedItem->isWatched
 * 3) 2 /var/www/mediawiki/includes/Title.php(1514): User->isWatched(Object(Title))
 * 4) 3 /var/www/mediawiki/includes/SkinTemplate.php(971): Title->userIsWatching
 * 5) 4 /var/www/mediawiki/includes/SkinTemplate.php(455): SkinTemplate->buildContentNavigationUrls
 * 6) 5 /var/www/mediawiki/includes/OutputPage.php(1982): SkinTemplate->outputPage
 * 7) 6 /var/www/mediawiki/includes/Exception.php(182): OutputPage->output
 * 8) 7 /var/www/mediawiki/includes/Exception.php(209): MWException->reportHTML
 * 9) 8 /var/www/mediawiki/includes/Exception.php(490): MWException->report
 * 10) 9 /var/www/mediawiki/includes/Exception.php(569): MWExceptionHandler::report(Object(DBQueryError))
 * 11) 10 /var/www/mediawiki/includes/Wiki.php(506): MWExceptionHandler::handle(Object(DBQueryError))
 * 12) 11 /var/www/mediawiki/index.php(58): MediaWiki->run
 * 13) 12 {main}

I had a quick look in the code and the postgresql documentation: It seems that the postgresql doesn't support the "LOCK IN SHARE MODE" feature the way, MySQL does.