Skip to main content

array_element_rows

Function array_element_rows 

Source
pub fn array_element_rows(
    arg: &Value<'_>,
    as_text: bool,
    fn_name: &str,
) -> Result<Vec<Option<String>>, EvalError>
Expand description

v7.37.17 (17.6 siblings) — set-returning function jsonb_array_elements[_text](json). PG semantics: one row per array element. _text renders scalars as their lexeme and JSON null as SQL NULL; the plain form renders every element (including JSON null) as compact JSON text. Non-array inputs raise an error (PG’s actual behaviour); SQL NULL produces 0 rows.

Returns the element texts as a Vec ready for FROM-clause materialisation (via the unnest rewrite in the parser).