Write a function to flatten a dict.
Implement this as a PostgreSQL function that accepts a jsonb object and returns one row for each non-object value, including values nested inside objects. Nested keys must be represented as dot-delimited paths. Arrays should remain intact as single jsonb values.
input_id, path, and value.input_id, then path.| Column | Type | Description |
|---|---|---|
| input_idPK | INT | Identifier for the JSON input |
| source_label | VARCHAR(40) | Optional label for the input |
| payload | JSONB | JSON object to flatten |