Open jawj opened 2 weeks ago
No, we do not currently have support for multidimensional arrays, and when we do, they will not be nested Vecs.
This is why they should not be nested Vecs:
# SELECT array_dims('{{1,2,3,4},{5,6},{7,8,9}}'::int[][]);
ERROR: malformed array literal: "{{1,2,3,4},{5,6},{7,8,9}}"
LINE 1: SELECT array_dims('{{1,2,3,4},{5,6},{7,8,9}}'::int[][]);
^
DETAIL: Multidimensional arrays must have sub-arrays with matching dimensions.
Vec<Vec<T>>
does not enforce this requirement. However, it is very simple to define a type that does (and indeed the real reason multidimensional array support has been blocked, right now, is "I'm too busy implementing fixes for everything else").
OK: thanks for the explanation, and for all your work on this project.
This bug report could be considered a duplicate of https://github.com/pgcentralfoundation/pgrx/issues/968 but I am currently considering retooling the RetAbi implementations so that this just does not work.
I have a function that returns a nested
Vec<Vec<f32>>
:I expected the same results as this:
But instead I get this:
Is this a bug, or have I misunderstood something?
Is there some other way I can return a nested
real[][]
array from a Rust function?