4 The pg_enum catalog contains entries showing the values and labels for
5 each enum type. The internal representation of a given enum value is
6 actually the OID of its associated row in pg_enum.
8 Table 52.20. pg_enum Columns
18 enumtypid oid (references pg_type.oid)
20 The OID of the pg_type entry owning this enum value
24 The sort position of this enum value within its enum type
28 The textual label for this enum value
30 The OIDs for pg_enum rows follow a special rule: even-numbered OIDs are
31 guaranteed to be ordered in the same way as the sort ordering of their
32 enum type. That is, if two even OIDs belong to the same enum type, the
33 smaller OID must have the smaller enumsortorder value. Odd-numbered OID
34 values need bear no relationship to the sort order. This rule allows
35 the enum comparison routines to avoid catalog lookups in many common
36 cases. The routines that create and alter enum types attempt to assign
37 even OIDs to enum values whenever possible.
39 When an enum type is created, its members are assigned sort-order
40 positions 1..n. But members added later might be given negative or
41 fractional values of enumsortorder. The only requirement on these
42 values is that they be correctly ordered and unique within each enum