]> begriffs open source - ai-pg/blob - full-docs/txt/catalog-pg-enum.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / catalog-pg-enum.txt
1
2 52.20. pg_enum #
3
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.
7
8    Table 52.20. pg_enum Columns
9
10    Column Type
11
12    Description
13
14    oid oid
15
16    Row identifier
17
18    enumtypid oid (references pg_type.oid)
19
20    The OID of the pg_type entry owning this enum value
21
22    enumsortorder float4
23
24    The sort position of this enum value within its enum type
25
26    enumlabel name
27
28    The textual label for this enum value
29
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.
38
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
43    type.