Expand description
Enum label input and output, ordered label functions and I/O casts through the statement’s catalog.
Values carry an immutable label key; the catalog supplies the current label text, so
ALTER TYPE ... RENAME VALUE never rewrites stored values. Comparisons use the key order and
need no catalog access.
Structs§
- Enum
Type Label - One label of an enum type.
- Enum
Type Labels - The labels of one enum type in ascending key order, which is declaration order.
Traits§
- Enum
Label Catalog - Catalog access for enum label input and output, supplied by the statement’s execution context and by catalog-aware binding.
Functions§
- call_
applies_ output_ functions - Whether a built-in call converts its arguments with their types’ output functions, so enum arguments contribute their current labels.
||concatenates text only when neither operand is an array; with an array operand it appends or prepends the enum value itself. - cast_
to_ enum - Cast a value to an enum type: identity for the same type,
enum_infor unknown literals and string-category sources, and 42846 otherwise. ReturnsNonewhen the target is not an enum. - contains_
enum_ carrier - Whether a value contains an enum carrier anywhere.
- enum_
endpoint enum_firstandenum_lastread only the argument’s type; the returned label must be usable.- enum_
function_ value - Evaluate one bound enum support function. Strict operations return NULL for any NULL argument before reading the catalog.
- enum_
label_ oid - Catalog OID of an enum value’s label, the datum
PostgreSQLstores for the value. - enum_
label_ text enum_out: the current label of a value.- enum_
output_ for_ cast - Cast an enum value to a string-category type through its label; any other target has no cast.
- enum_
range enum_range(lower, upper): labels fromlowerthroughupperinclusive, where a missing bound is open. A lower bound after the upper bound yields an empty array. Every returned label must be usable.- enum_
value_ from_ text enum_in: the label with exactly this text. Case and surrounding spaces are significant.- fold_
unknown_ literal - Convert an
unknownliteral to an enum or enum-array type with the type’s input function, asPostgreSQLdoes when it coerces an untyped constant during parse analysis. ReturnsNonefor any other target. - is_
enum_ bearing - Whether a declared type is an enum or an array whose leaf is an enum.
- render_
call_ arguments - Render the enum carriers of an output-function call’s arguments as their labels.
- render_
enum_ labels - Replace every enum carrier inside a value by its label text, as the output functions of containers do.
- render_
host_ arguments - Arguments handed to host-registered functions: enum values become their labels, as procedural languages receive them through the type’s output function.