1.1 Logical Structure of Database Cluster

kakaxi9521發表於2021-07-05

1.1. Logical Structure of Database Cluster

Figure 1.1 shows the logical structure of a database cluster. A database is a collection of database objects. In the relational database theory, a database object is a data structure used either to store or to reference data. A (heap) table is a typical example of it, and there are many more like an index, a sequence, a view, a function and so on. In PostgreSQL, databases themselves are also database objects and are logically separated from each other. All other database objects (e.g., tables, indexes, etc) belong to their respective databases.


圖1.1 展示了資料庫的邏輯結構。  資料庫中包含了表、索引、檢視、函式、序列等。 在資料庫叢集中每個資料庫是相互獨立的。



All the database objects in PostgreSQL are internally managed by respective object identifiers (OIDs), which are unsigned 4-byte integers. The relations between database objects and the respective OIDs are stored in appropriate  system catalogs, depending on the type of objects. For example, OIDs of databases and heap tables are stored in pg_database and pg_class respectively, so you can find out the OIDs you want to know by issuing the queries such as the following:


PostgreSQL 資料庫中的所有物件都有自己的Object ID(OID)。  這些物件的object id 都儲存在system catalogs中。

例如:資料庫和表的oids 分別記錄在pg_database, pg_class中。 可以透過下列命令進行查詢:


參考文件:




來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/21374452/viewspace-2779726/,如需轉載,請註明出處,否則將追究法律責任。

相關文章