Postgres システムカタログについて

Having introduced the basic extensibility concepts, we can now take a look at how the catalogs are actually laid out. You can skip this section for now, but some later sections will be incomprehensible without the information given here, so mark this page for later reference. All system catalogs have names that begin with pg_. The following classes contain information that may be useful to the end user. (There are many other system catalogs, but there should rarely be a reason to query them directly.)

ここまでで拡張性の基礎的な概念についての紹介が終りましたので、 ここからはカタログが実際にどう設置されているかを示すことにしま す。今のところこの節を飛ばしても構いませんが、この節の情報無し では少し後の節を理解することはできないと思います。後で参照でき るように印をつけておいて下さい。全システムカタログの名前は pg_から始まります。後述のクラスは、エン ドユーザにとって有益になるような情報を持っています。(他にも多 くのシステムカタログがありますが、直接それらを問い合わせなけれ ばならないような理由はほとんどないはずです。)

Table 3-1. Postgres システムカタログ

カタログ名説明
pg_database データベース
pg_class クラス
pg_attribute クラス属性
pg_index 二次インデックス
pg_proc プロシージャ( C 及び SQL )
pg_type 型(基本型及び複合型)
pg_operator 演算子
pg_aggregate 集約及び集約関数
pg_am アクセスメソッド
pg_amop アクセスメソッド演算子
pg_amproc アクセスメソッド・サポート関数
pg_opclass アクセスメソッド演算子クラス

Figure 3-1. 主な Postgres システムカタログ

The Reference Manual gives a more detailed explanation of these catalogs and their attributes. However, 主な Postgres システムカタログ shows the major entities and their relationships in the system catalogs. (Attributes that do not refer to other entities are not shown unless they are part of a primary key.) This diagram is more or less incomprehensible until you actually start looking at the contents of the catalogs and see how they relate to each other. For now, the main things to take away from this diagram are as follows: レファレンスマニュアルにはこれらカタログとその属性についてより 詳細な説明があります。しかし、 主な Postgres システムカタログ は システムカタログ内の主な実体とその間のリレーションを示して います。(プライマリキーの一部ではない限り他の実体を参照 していない属性は示されていません。)実際にカタログの内容をみ て、それらが互いにどう関係するのかを理解していない場合は、こ の図は多少理解しづらいものです。さしあたり、この図から読みと ることができる主なものを以下に示します。