バージョンごとのドキュメント一覧

53.20. pg_enum #

The <structname>pg_enum</structname> catalog contains entries showing the values and labels for each enum type. The internal representation of a given enum value is actually the OID of its associated row in <structname>pg_enum</structname>. pg_enumカタログは、各列挙型についてその値とラベルを示す項目を含みます。 ある与えられた列挙値の内部表現は、実際にはpg_enum内の関連付けられた行のOIDです。

表53.20 pg_enumの列

<title><structname>pg_enum</structname> Columns</title>

Column Type 列 型

Description 説明

oid oid

Row identifier 行識別子

enumtypid oid (references <link linkend="catalog-pg-type"><structname>pg_type</structname></link>.<structfield>oid</structfield>) (参照先 pg_type.oid

The OID of the <link linkend="catalog-pg-type"><structname>pg_type</structname></link> entry owning this enum value この列挙値を所有しているpg_type項目のOID

enumsortorder float4

The sort position of this enum value within its enum type 列挙型におけるこの列挙値のソート位置

enumlabel name

The textual label for this enum value この列挙値のテキストラベル


The OIDs for <structname>pg_enum</structname> rows follow a special rule: even-numbered OIDs are guaranteed to be ordered in the same way as the sort ordering of their enum type. That is, if two even OIDs belong to the same enum type, the smaller OID must have the smaller <structfield>enumsortorder</structfield> value. Odd-numbered OID values need bear no relationship to the sort order. This rule allows the enum comparison routines to avoid catalog lookups in many common cases. The routines that create and alter enum types attempt to assign even OIDs to enum values whenever possible. pg_enum行のOIDは次のような特別な規則に従います。 列挙型のソート順序と同じ順序で並んだ偶数のOIDが保証されています。 つまり、2つの偶数のOIDが同じ列挙型に属する場合、OIDの小さい方がより小さいenumsortorder値を持たなければなりません。 奇数のOID値はソート順序に関連を持ってはなりません。 この規則により列挙の比較処理は多くの一般的な場合でカタログの検索を防ぐことができます。 列挙型の作成および変更を行う処理は、可能であれば偶数のOIDを列挙値に割り当てようとします。

When an enum type is created, its members are assigned sort-order positions 1..<replaceable>n</replaceable>. But members added later might be given negative or fractional values of <structfield>enumsortorder</structfield>. The only requirement on these values is that they be correctly ordered and unique within each enum type. 列挙型を作成する時、そのメンバには1..nのソート順位置が割り当てられます。 しかし後で追加されたメンバには負もしくはenumsortorderの小数値が与えられる可能性があります。 これらの値の要件は、各列挙型の中で正しく順序付けされ、かつ一意であることだけです。