Manual:redirect table

From MediaWiki.org
Jump to: navigation, search
Language:Project:Language policy English  • 日本語
Manual:ContentsManual:Contents MediaWiki database layoutManual:Database layout redirect table


Contains for each page that is currently a redirect (i.e., not for old revisions which are redirects) the id of the source page and the information about target. The target page may or may not exist.

NOTE: as of August 2007, database dumps for Wikipedia and other Wikimedia projects as provided on https://dumps.wikimedia.org/ have incomplete data in this table: only redirect pages that have been created or edited after summer 2007 are present. For older redirects, resort to using the pagelinks table.

Fields[edit]

A target is broken into four parts: interwiki prefix (should be empty for a regular redirect), namespace, title and fragment.

rd_from[edit]

Contains the page_id of the source page.

rd_namespace[edit]

Contains the number of the target's namespace.

rd_title[edit]

Contains the sanitized title of the target page. It is stored as text, with spaces replaced by underscores.

rd_fragment[edit]

Contains the target's fragment ID if present (see also bugzilla:218), otherwise is NULL.

rd_interwiki[edit]

MediaWiki version: 1.16

This field is not empty only if an interwiki prefix is used: #REDIRECT [[prefix:…]] (a prefix such as "w:" for Wikipedia, or an interlanguage link prefix such as "nl:" for Dutch, but not both). In this case a redirect is not visible in Special:WhatLinksHere (even if the target lies in the same wiki), rd_namespace is always 0 and rd_title may contain a possible namespace prefix, but rd_fragment may be non-NULL.

Schema summary[edit]

MediaWiki version: 1.16

DESCRIBE redirect;

+--------------+---------------------+------+-----+---------+-------+
| Field        | Type                | Null | Key | Default | Extra |
+--------------+---------------------+------+-----+---------+-------+
| rd_from      | int(10) unsigned    | NO   | PRI | 0       |       |
| rd_namespace | int(11)             | NO   | MUL | 0       |       |
| rd_title     | varchar(255) binary | NO   |     | NULL    |       |
| rd_interwiki | varchar(32)         | YES  |     | NULL    |       |
| rd_fragment  | varchar(255) binary | YES  |     | NULL    |       |
+--------------+---------------------+------+-----+---------+-------+


MediaWiki versions: 1.10 – 1.15

DESCRIBE redirect;

+--------------+---------------------+------+-----+---------+-------+
| Field        | Type                | Null | Key | Default | Extra |
+--------------+---------------------+------+-----+---------+-------+
| rd_from      | int(10) unsigned    | NO   | PRI | 0       |       |
| rd_namespace | int(11)             | NO   | MUL | 0       |       |
| rd_title     | varchar(255) binary | NO   |     | NULL    |       |
+--------------+---------------------+------+-----+---------+-------+


MediaWiki version: 1.9

DESCRIBE redirect;

+--------------+---------------------+------+-----+---------+-------+
| Field        | Type                | Null | Key | Default | Extra |
+--------------+---------------------+------+-----+---------+-------+
| rd_from      | int(8) unsigned     | NO   | PRI | 0       |       |
| rd_namespace | int(11)             | NO   | MUL | 0       |       |
| rd_title     | varchar(255) binary | NO   |     | NULL    |       |
+--------------+---------------------+------+-----+---------+-------+
DatabasesManual:Database layout Engines: MySQL/MariaDBManual:MySQLOracleManual:OraclePostgreSQLManual:PostgreSQLSQLiteManual:SQLiteSQL ServerManual:Microsoft SQL Server

Technical documentation: SchemaManual:Database layout (tablesCategory:MediaWiki database tables) – API property associationsAPI:Database field and API property associationsField prefixesDatabase field prefixesPrimary key storage in other fieldsManual:Primary key storage in other fieldsWikimedia extension tablesCategory:Wikimedia extension database tables
Configuration: SettingsManual:Configuration_settings#Database_settingsSharingManual:Shared database
Development: AccessManual:Database accessOptimizationDatabase optimizationPolicyDevelopment policy#Database_patchesUpdaterManual:DatabaseUpdater.phpExtension schema updatesManual:Hooks/LoadExtensionSchemaUpdatesPatch fileManual:SQL patch file

Core tables: archivebot_passwordscategorycategorylinkschange_tagcommentconfigexternallinksfilearchivehitcounterimageimagelinksimage_comment_tempinterwikiiwlinksipblocksip_changesjobl10n_cachelanglinkslogginglog_searchmsg_resourcemsg_resource_linksmodule_depsobjectcacheoldimagepagepagelinkspage_propspage_restrictionsprotected_titlesquerycachequerycachetwoquerycache_inforecentchangesredirectrevisionrevision_comment_tempsearchindexsitessite_identifiers - site_statstag_summarytemplatelinkstexttranscacheupdateloguploadstashuseruser_former_groupsuser_groupsuser_newtalkuser_propertiestag_summaryvalid_tagwatchlist