I have some category table, and I'm trying to get flat array something like this
select([psql.array_agg(category.c.name)])
Expected result:
["foo", "bar", "etc"]
Actual result:
[
{
"array_agg_1": ["foo", "bar", "etc"]
}
]
I have tried many different options. But they are all more like workaround. What is most interesting, everything looks good in postgres console.
select array_agg(name) from category
{foo,bar,etc}
Why is this happening and how to solve it without additional subselecting, getting item by key and etc?