Re: Like to RETURN SQL results set - Mailing list pgsql-admin

From Scott Ribe
Subject Re: Like to RETURN SQL results set
Date
Msg-id ADC7EAFA-4743-42C6-B278-8DE2AD18700E@elevated-dev.com
Whole thread Raw
In response to Re: Like to RETURN SQL results set  (M Sarwar <sarwarmd02@outlook.com>)
Responses Re: Like to RETURN SQL results set
List pgsql-admin
> On Mar 28, 2024, at 9:39 PM, M Sarwar <sarwarmd02@outlook.com> wrote:
>
> I could not follow JSON part. Do you have any case where I can see JSON is used to solve this type of problem.

To get json back, take any query and wrap it in

'select array_to_json(array_agg(row_to_json(t)))::text from (' || query || ') as t;'





pgsql-admin by date:

Previous
From: M Sarwar
Date:
Subject: Re: Like to RETURN SQL results set
Next
From: M Sarwar
Date:
Subject: Re: Like to RETURN SQL results set