I have objects in postgres db in one column:
{"svc": {"times": [1.2, 1.3, 1.4]}}
{"svc": {"times": [1.6, 2.3, 5.5]}}
...
And with select query:
SELECT services->'svc'->>'times'
I get rows with strings:
"[1.2, 1.3, 1.4]"
"[1.6, 2.3, 5.5]"
or with SELECT json_agg(services->'svc'->>'times')
:
["[1.2, 1.3, 1.4]", "[1.6, 2.3, 5.5]"]
But I need an arrays (one array will be good as well):
[1.2, 1.3, 1.4]
[1.6, 2.3, 5.5]
So I can process it with python script (but I want to get array directly from db). i.e.
rows = select_result
my_list = []
for row in rows:
my_list.extend(row)
Tried lot of pg functions (split, array) for that but nothing woks well. Should I change type of data stored to achieve this by default?