↑↓ 选择↵ 打开⌫ 切换范围完整搜索

PG.CENTER 连接 PostgreSQL 文档、百科与生态知识。由 Pigsty 维护。

支持中的版本: 当前版本 (18) / 17 / 16 / 15 / 14
开发中的版本: 19 / 20devel
已结束支持的版本: 13 / 12 / 11 / 10 / 9.6 / 9.5 / 9.4 / 9.3 / 9.2 / 9.1 / 9.0 / 8.4 / 8.3 / 8.2 / 8.1 / 8.0 / 7.4 / 7.3 / 7.2 / 7.1
历史版本。 PostgreSQL 9.1 已结束支持。 2016-10-27. 请参阅 当前版本手册.

第 45 章 系统目录

系统目录是关系型数据库管理系统存放模式元数据的地方,例如表和列的信息以及内部记账信息。PostgreSQL 的系统目录是普通表。你可以删除并重建这些表、增加列、插入和更新数值,并借此把系统严重搞坏。通常,不应手工修改系统目录,总是有 SQL 命令可用于完成这些操作。(例如,CREATE DATABASE 会向 pg_database 目录中插入一行 — 并且实际上会在磁盘上创建该数据库。)对于某些特别深奥的操作存在一些例外,例如增加索引访问方法。

45.1. 概述 #

表 45.1列出了系统目录。每个目录更详细的文档见后文。

大多数系统目录在创建数据库时都会从模板数据库复制过来,因此之后是数据库专有的。少数目录在物理上由一个集簇中的所有数据库共享;这些目录会在各自的说明中注明。

表 45.1. 系统目录

Catalog NamePurpose
pg_aggregateaggregate functions
pg_amindex access methods
pg_amopaccess method operators
pg_amprocaccess method support procedures
pg_attrdefcolumn default values
pg_attributetable columns (“attributes”)
pg_authidauthorization identifiers (roles)
pg_auth_membersauthorization identifier membership relationships
pg_castcasts (data type conversions)
pg_classtables, indexes, sequences, views (“relations”)
pg_constraintcheck constraints, unique constraints, primary key constraints, foreign key constraints
pg_collationcollations (locale information)
pg_conversionencoding conversion information
pg_databasedatabases within this database cluster
pg_db_role_settingper-role and per-database settings
pg_default_acldefault privileges for object types
pg_dependdependencies between database objects
pg_descriptiondescriptions or comments on database objects
pg_enumenum label and value definitions
pg_extensioninstalled extensions
pg_foreign_data_wrapperforeign-data wrapper definitions
pg_foreign_serverforeign server definitions
pg_foreign_tableadditional foreign table information
pg_indexadditional index information
pg_inheritstable inheritance hierarchy
pg_languagelanguages for writing functions
pg_largeobjectdata pages for large objects
pg_largeobject_metadatametadata for large objects
pg_namespaceschemas
pg_opclassaccess method operator classes
pg_operatoroperators
pg_opfamilyaccess method operator families
pg_pltemplatetemplate data for procedural languages
pg_procfunctions and procedures
pg_rewritequery rewrite rules
pg_seclabelsecurity labels on database objects
pg_shdependdependencies on shared objects
pg_shdescriptioncomments on shared objects
pg_statisticplanner statistics
pg_tablespacetablespaces within this database cluster
pg_triggertriggers
pg_ts_configtext search configurations
pg_ts_config_maptext search configurations' token mappings
pg_ts_dicttext search dictionaries
pg_ts_parsertext search parsers
pg_ts_templatetext search templates
pg_typedata types
pg_user_mappingmappings of users to foreign servers

报告文档问题

阅读 上游文档. 反馈更正前请先核对 当前版本手册.