pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Ribe <scott_ribe@elevated-dev.com>
To: M Sarwar <sarwarmd02@outlook.com>
Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Re: Like to RETURN SQL results set
Date: Thu, 28 Mar 2024 21:54:25 -0600
Message-ID: <ADC7EAFA-4743-42C6-B278-8DE2AD18700E@elevated-dev.com> (raw)
In-Reply-To: <DM4PR19MB59786F00F47E75A4681FF374D33A2@DM4PR19MB5978.namprd19.prod.outlook.com>
References: <PH2P110MB0922721CBEE6FECB56E1A0F7FF34A@PH2P110MB0922.NAMP110.PROD.OUTLOOK.COM>
	<DM4PR19MB5978E0422300C922982974EBD3342@DM4PR19MB5978.namprd19.prod.outlook.com>
	<2ed4638d9de6042890f9b95aa596513ffe163416.camel@cybertec.at>
	<DM4PR19MB5978F71CFF8C6626DD0DD5F8D33B2@DM4PR19MB5978.namprd19.prod.outlook.com>
	<hxq6kue5366iodbhhpzlfhb67ppd4s3twt43dwckelnmloul4c@j6u3hsbf4pah>
	<DM4PR19MB59786F00F47E75A4681FF374D33A2@DM4PR19MB5978.namprd19.prod.outlook.com>

> 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;'







view thread (9+ messages)  latest in thread

Message-ID: <ADC7EAFA-4743-42C6-B278-8DE2AD18700E@elevated-dev.com>
Permalink:  ../ADC7EAFA-4743-42C6-B278-8DE2AD18700E@elevated-dev.com/
Also on:    postgresql.org/message-id/ADC7EAFA-4743-42C6-B278-8DE2AD18700E@elevated-dev.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: scott_ribe@elevated-dev.com, sarwarmd02@outlook.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Like to RETURN SQL results set
  In-Reply-To: <ADC7EAFA-4743-42C6-B278-8DE2AD18700E@elevated-dev.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox