pg_array_utils
pg_array_utils · Polymorphic array flattening, chunking, zipping, padding and slicing functions.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 102350 | pg_array_utils | pg_array_utils | 1.0 | FUNC | C |
PostgreSQL · 18
Usage
Sources:
pg_array_utils 1.0 is a C extension for array transformations from a PostgreSQL training repository. The documented environment is PostgreSQL 18.4; broader major-version support and a distribution license are not established.
Array transformations
The extension is relocatable and requires no preload. Its C functions use ordinary extension installation privileges.
Function index and limits
array_flatten flattens dimensions; array_chunk partitions a one-dimensional array; array_zip returns JSONB tuples from variadic arrays; array_compact removes selected empty values; array_pad pads to a target size; array_slice selects a stepped range; array_repeat repeats a scalar or array. The padding and repeat overloads distinguish scalar and array arguments. Functions are declared IMMUTABLE STRICT, so SQL NULL arguments short-circuit to NULL.
array_chunk and array_compact reject multidimensional inputs. Follow the documented index, dimension and type rules rather than assuming Python slicing semantics. Large results remain limited by PostgreSQL allocation limits; this is not a streaming array processor.