Skip to main content

jsonb_each_text_rows

Function jsonb_each_text_rows 

Source
pub fn jsonb_each_text_rows(
    arg: &Value<'_>,
) -> Result<Vec<(String, Option<String>)>, EvalError>
Expand description

v6.4.5 — PG json #> path_text / json #>> path_text. The right-hand side is a PG text-array literal '{a,0,b}' whose elements are walked left-to-right; each element is either an object key or (when it parses as a non-negative integer) an v7.37.43-T4.5 — set-returning function jsonb_each_text(jsonb). PG semantics: for each (key, value) pair in the object, emit one row whose key column is the literal key and value column is the JSON value rendered as text (null → SQL NULL, primitives → their lexeme, nested objects/arrays → JSON text).

Returns the (key, value) tuples as a Vec ready for FROM-clause materialisation. Non-object inputs raise an error (PG’s actual behaviour); NULL and empty object both produce 0 rows.