Yes it would be a simple array, but it costs a lot of coding. Because every
item in the array need to be inserted in the function to_json().
Example:
DECLARE
_arr json[];
FOR row in SELECT * FROM persons LOOP
_arr := array_append (_arr, ARRAY(to_json(row.id),
to_json(row.birthdate), to_json (row.active_bool),to_json(row.level));
END LOOP;
RETURN to_json(_arr);
On 23 September 2013 08:42, Luca Ferrari <fluca1978(at)infinito(dot)it> wrote:
> On Sat, Sep 21, 2013 at 10:26 PM, Tjibbe R <tjibbe(at)rijpma(dot)org> wrote:
> > Hello,
> >
> > Why isn't there a row_to_json_array(record) funtion?
> >
>
> I'm not a json expert, but it could be the output would not be a json
> structure (after all, it would be a simple array)?
>
> Luca
>