1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| my_testdb=# with recursive flat (id, path, value) as ( select id, key, value from test_jsonb, jsonb_each(msg) union select f.id, concat(f.path, '.', j.key), j.value from flat f, jsonb_each(f.value) j where jsonb_typeof(f.value) = 'object') select id, path, value from flat where path ~ 'RootModule.path';
id | path | value
2 | RootModule.path | [1] (1 row)
my_testdb=# with recursive flat (id, path, value) as ( select id, key, value from test_jsonb, jsonb_each(msg) union select f.id, concat(f.path, '.', j.key), j.value from flat f, jsonb_each(f.value) j where jsonb_typeof(f.value) = 'object' ) select id, path, value from flat where path ~ any(array['humanstring','RootModule.path']);
id | path | value
2 | RootModule.path | [1] 2 | RootModule.tags.ModuleBase1.humanstring | "40640" (2 rows)
|