JuliaDatabases / LibPQ.jl

A Julia wrapper for libpq
MIT License
217 stars 51 forks source link

Using array_agg results in a string #268

Closed robertsmit closed 1 year ago

robertsmit commented 1 year ago

When querying something like SELECT Array[1,3] as col1

just results in a row with a vector.

But when using something like: Select array_agg(t.textval) as col1 from table t group by true Give me a string.

Is this a known issue. I expect to get a Vector as col1 result.

robertsmit commented 1 year ago

relates to

saw something about that it only works for integers.

iamed2 commented 1 year ago

Yes I think that linked issue (https://github.com/iamed2/LibPQ.jl/issues/58) covers the feature request, since array_agg does work on integers:

julia> execute(conn, "SELECT array_agg(t.ns) FROM (VALUES (1),(2)) AS t (ns);")[1,1]
2-element Vector{Union{Missing, Int32}}:
 1
 2