↑↓ select ↵ open ⌫ change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Functions / Enum Support Functions

Returns all values of the input enum type in an ordered array.

Reading PG 18current·documented in 20 of 27 versions, 8.3 to 20

Signatures & examples

enum_range ( anyenum ) → anyarray
Returns all values of the input enum type in an ordered array.
enum_range(null::rainbow) → {red,orange,yellow,​green,blue,purple}
enum_range ( anyenum, anyenum ) → anyarray
Returns the range between the two given enum values, as an ordered array. The values must be from the same enum type. If the first parameter is null, the result will start with the first value of the enum type. If the second parameter is null, the result will end with the last value of the enum type.
enum_range('orange'::rainbow, 'green'::rainbow) → {orange,yellow,green}
enum_range(NULL, 'green'::rainbow) → {red,orange,​yellow,green}
enum_range('orange'::rainbow, NULL) → {orange,yellow,green,​blue,purple}
Version history 2
  1. 12 → 13 changed
  2. 8.2 → 8.3 added

Definition snapshot: b7bd9cda · English manual source