Toolserver:Toolserver database

The "toolserver" database contains metadata about the various Wikimedia wikis and databases. It consists of four tables: language, namespace, namespacename, and wiki.

The "toolserver" database exists on every host, so it's possible to JOIN against it with every database. The database updates daily.

namespace
This table contains the primary namespace names for the wikis in the wiki table. Use of this table is deprecated, use the namespacename table instead, which covers all valid names for each namespace in each wiki, not just the primary names.

namespacename

 * ns_type:
 * canonical: works on all wikis regardless of configuration
 * primary: used in urls, omitted if identical to canonical
 * alias: alternative name for namespace. Aliases and canonical names can be used in links, when performing a search.
 * ns_is_favorite: true(1) for primary namespace name.
 * If primary and canonical names are identical (e.g. on enwiki) this flag is enabled on the canonical type because in this case there is no row containing a primary type for this namespace (see above).

This table is useful for localizing the namespace name in query results. For example: This query would produce:

wiki
This table is especially useful for looking up the host of a wiki database. For example: This query would produce: This tells you that the dewiki_p database is located on the sql-s5 host.

The wiki table is also useful for things like link generation. You can select the domain name from the table for a given database to create proper working hyperlinks.