Postgresql 中文操作指南

Chapter 5. Data Definition

Table of Contents

本章介绍如何创建将保存数据的数据库结构。在关系数据库中,原始数据存储在表格中,因此本章大部分内容都致力于解释如何创建和修改表格以及可以控制在表格中存储什么数据的可用功能。随后,我们将讨论如何将表格组织到架构中,以及如何向表格分配权限。最后,我们将简要介绍影响数据存储的其他功能,例如继承、表格分区、视图、函数和触发器。

This chapter covers how one creates the database structures that will hold one’s data. In a relational database, the raw data is stored in tables, so the majority of this chapter is devoted to explaining how tables are created and modified and what features are available to control what data is stored in the tables. Subsequently, we discuss how tables can be organized into schemas, and how privileges can be assigned to tables. Finally, we will briefly look at other features that affect the data storage, such as inheritance, table partitioning, views, functions, and triggers.