Postgresql 中文操作指南

Chapter 53. System Catalogs

Table of Contents

系统目录是关系数据库管理系统存储模式元数据(例如有关表和列的信息)和内部簿记信息的地方。PostgreSQL 的系统目录是常规表。您可以丢弃和重新创建表、添加列、插入和更新值以及严重搞乱您的系统。通常情况下,不应手动更改系统目录,通常会有 SQL 命令来执行此操作。(例如, CREATE DATABASEpg_database 目录中插入一行 —— 并实际上在磁盘上创建数据库。)有一些例外情况适用于特别深奥的操作,但随着时间的推移,其中许多已作为 SQL 命令提供,因此对系统目录进行直接操作的需求正在不断减少。

The system catalogs are the place where a relational database management system stores schema metadata, such as information about tables and columns, and internal bookkeeping information. PostgreSQL’s system catalogs are regular tables. You can drop and recreate the tables, add columns, insert and update values, and severely mess up your system that way. Normally, one should not change the system catalogs by hand, there are normally SQL commands to do that. (For example, CREATE DATABASE inserts a row into the pg_database catalog — and actually creates the database on disk.) There are some exceptions for particularly esoteric operations, but many of those have been made available as SQL commands over time, and so the need for direct manipulation of the system catalogs is ever decreasing.