pub fn jsonb_compare(a: &JsonValue, b: &JsonValue) -> OrderingExpand description
v7.38 (read01 P6.24) — PG’s jsonb total order (ORDER BY / DISTINCT /
btree). First by type rank Null < String < Number < Boolean < Array < Object; then within a type: strings by content, numbers numerically,
booleans false < true, arrays by length then element-wise, objects by
pair-count then key/value pairwise (keys in canonical stored order).
Mirrors the observable behaviour of jsonb.c’s compareJsonbContainers.