Re: Like to RETURN SQL results set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Scott,

I need to work on this to explore this option.
Thanks a lot!
Sarwar


From: Scott Ribe <scott_ribe@xxxxxxxxxxxxxxxx>
Sent: Thursday, March 28, 2024 11:54 PM
To: M Sarwar <sarwarmd02@xxxxxxxxxxx>
Cc: pgsql-admin@xxxxxxxxxxxxxxxxxxxx <pgsql-admin@xxxxxxxxxxxxxxxxxxxx>
Subject: Re: Like to RETURN SQL results set
 
> On Mar 28, 2024, at 9:39 PM, M Sarwar <sarwarmd02@xxxxxxxxxxx> 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;'



[Index of Archives]     [Postgresql Home]     [Postgresql General]     [Postgresql Performance]     [Postgresql PHP]     [Postgresql Jobs]     [PHP Users]     [PHP Databases]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Forum]

  Powered by Linux