It would be great if Postgres arrays would be returned as bare, well-formed JSON lists, so that a result would look like this:
{ "rows": [
{ "col1": "foo", "arr1": [ "foo", "bar", "baz" ] }
]}
..including correct typing (no quotes around int[] or float[], etc).
The main benefit is ease of use by applications, not having to do something like a list comprehension to obtain the list of values.
The drawbacks include: Postgres only; XML has no concept of a list, so there would have to be a work-around using a parent-child element list.
This is a feature I've enjoyed immensely in the Python psycopg2 interface, and would love to carry on using it!
It would be great if Postgres arrays would be returned as bare, well-formed JSON lists, so that a result would look like this:
..including correct typing (no quotes around int[] or float[], etc).
The main benefit is ease of use by applications, not having to do something like a list comprehension to obtain the list of values.
The drawbacks include: Postgres only; XML has no concept of a list, so there would have to be a work-around using a parent-child element list.
This is a feature I've enjoyed immensely in the Python psycopg2 interface, and would love to carry on using it!