Page MenuHomePhabricator

Prepending minus sign(-) to search query causes PostgreSQL Error
Closed, ResolvedPublic


Author: onnojongbloed

Affected system:

  • MediaWiki: 1.11.0 (r29485)
  • PHP: 5.2.5 (apache2handler)
  • PostgreSQL: PostgreSQL 8.2.5 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC) 3.4.2 (mingw-special)


  1. This doesn't seem to happen on a mediawiki running on mySQL.
  2. Enter any text in the search query field. Confirm that the search works as intended.
  3. Now, prepend a minus sign (0x2D) and press either 'Go' or 'Search'.

Additional notes:

Our installation is slightly modified due to bugs 12365, 12522, 9417.

The error, as reported by mediawiki is:
Internal error

A database error has occurred Query: SELECT page_id, page_namespace, page_title, rank(titlevector, to_tsquery('default','! byebyelotsofcake'), 1) AS score FROM page p, revision r, pagecontent c WHERE p.page_latest = r.rev_id AND r.rev_text_id = c.old_id AND titlevector @@ to_tsquery('default','! byebyelotsofcake') AND page_is_redirect = 0 AND page_namespace IN (0) ORDER BY score DESC, page_id DESC LIMIT 20 OFFSET 0 Function: Error: 1 ERROR: Query requires full scan, GIN doesn't support it


#0 D:\wiki\wiki\includes\Database.php(779): DatabasePostgres->reportQueryError('ERROR: Query r...', 1, 'SELECT page_id,...', '', false)
#1 D:\wiki\wiki\includes\SearchPostgres.php(40): Database->query('SELECT page_id,...')
#2 D:\wiki\wiki\includes\SpecialSearch.php(157): SearchPostgres->searchTitle('-byebyelotsofca...')
#3 D:\wiki\wiki\includes\SpecialSearch.php(38): SpecialSearch->showResults('-byebyelotsofca...')
#4 D:\wiki\wiki\includes\SpecialPage.php(653): wfSpecialSearch(NULL, Object(SpecialPage))
#5 D:\wiki\wiki\includes\SpecialPage.php(459): SpecialPage->execute(NULL)
#6 D:\wiki\wiki\includes\Wiki.php(201): SpecialPage::executePath(Object(Title))
#7 D:\wiki\wiki\includes\Wiki.php(45): MediaWiki->initializeSpecialCases(Object(Title), Object(OutputPage), Object(WebRequest))
#8 D:\wiki\wiki\index.php(89): MediaWiki->initialize(Object(Title), Object(OutputPage), Object(User), Object(WebRequest))
#9 {main}

Version: 1.11.x
Severity: normal
OS: Windows Server 2003
Platform: PC



Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:05 PM
bzimport set Reference to bz13004.
bzimport added a subscriber: Unknown Object (MLST).

This is a GIN/GIST bug. I've created a workaround for it in r31019, please give it a try.

Jdforrester-WMF subscribed.

Migrating from the old tracking task to a tag for PostgreSQL-related tasks.

Restricted Application added a subscriber: TerraCodes. · View Herald Transcript