Manual:text table

(Redirected from Text table)
Jump to: navigation, search
Translate this page; This page contains changes which are not marked for translation.

Other languages:
English • ‎日本語 • ‎polski
Manual:ContentsManual:Contents MediaWiki database layoutManual:Database layout text table

MediaWiki version: 1.5

The text table holds the wikitext of individual page revisions. If using Postgres or Oracle, this table is named pagecontent. Extensions may also store data here.

Field names are a holdover from the oldManual:old table revisions table in MediaWiki 1.4 and earlier.

If you updated your wiki from MediaWiki 1.4 or older to a newer version, and if you have then run update.php at least once, you will still have old columns in the text table, whose contents have been migrated to the pageManual:page table table and the revisionManual:revision table table (content is copied, not cut). These columns in the text table will not be used anymore. All fields in the text table except old_id, old_text and old_flags are not needed anymore and can be safely deleted.

Text content can be compressed or stored externally, and thus difficult to get from this table. The fetchText.php maintenance script can be used to retrieve the text of a given old_id.

Schema summary[edit]

MediaWiki version: 1.10


| Field     | Type            | Null | Key | Default | Extra          |
| old_id    | int(8) unsigned | NO   | PRI | NULL    | AUTO_INCREMENT |
| old_text  | mediumblob      | NO   |     | NULL    |                |
| old_flags | tinyblob        | NO   |     | NULL    |                |

MediaWiki versions: 1.5 – 1.9


| Field     | Type            | Null | Key | Default | Extra          |
| old_id    | int(8) unsigned | NO   | PRI | NULL    | AUTO_INCREMENT |
| old_text  | mediumblob      | NO   |     | NULL    |                |
| old_flags | tinyblob        | NO   |     | NULL    |                |



Unique integer used to identify each text. revision.rev_text_idManual:revision table#rev_text_id in revisionManual:revision table table and archiveManual:Archive table table. ar_text_idManual:Archive table#ar_text_id are keys to this column.


The wikitext of the page.


Comma-separated list of flags. Contains the following possible values:

gzip Text is compressed with PHP's gzdeflate() function.
Note Note: If the $wgCompressRevisions option is on, new rows (=current revisions) will be gzipped transparently at save time. Previous revisions can also be compressed by using the script compressOld.phpManual:compressOld.php
utf-8 Text was stored as UTF-8.
Note Note: If the $wgLegacyEncoding option is on, rows without this flag will be converted to UTF-8 transparently at load time.
object Text field contained a serialized PHP object.
Note Note: The object either contains multiple versions compressed together to achieve a better compression ratio, or it refers to another row where the text can be found.
external Text was stored in an external location specified by old_text.
Note Note: Any additional flags apply to the data stored at that URL, not the URL itself. The 'object' flag is not set for URLs of the form 'DB://cluster/id/itemid', because the external storage system itself decompresses these. See also $wgDefaultExternalStore.

Extensions can add other custom flags.

See also[edit]

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