Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

CROSS JOIN LATERAL jsonb_array_elements (jsonb_extract_path (cf.jsonb, 'selectField', 'options', 'values')) AS values (jsonb)
----- "jsonb_array_elements" works on the 'values' element in array object at the end of the parentheses; we use this extract function expression because "values" is an array
----- "jsonb_extract_path" works on the "selectField" and "options" objects – the objects listed must be in the same hierarchical order as they appear in the table
----- the entire cross join statement produces a jsonb object that which I named named "values" (note: what you name this object is totally arbitrary - you could call it "stuff" if you felt like it – "stuff (jsonb)")


LEFT JOIN folio_users.custom_fields__t AS cft  

...