Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rq3KG-00AHKR-09 for pgsql-admin@arkaria.postgresql.org; Fri, 29 Mar 2024 03:54:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rq3KD-00ADRy-Ly for pgsql-admin@arkaria.postgresql.org; Fri, 29 Mar 2024 03:54:41 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rq3KD-00ADQm-8I for pgsql-admin@lists.postgresql.org; Fri, 29 Mar 2024 03:54:41 +0000 Received: from mailout.easymail.ca ([64.68.200.34]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rq3K9-006zWp-H7 for pgsql-admin@lists.postgresql.org; Fri, 29 Mar 2024 03:54:39 +0000 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id 31A156E338; Fri, 29 Mar 2024 03:54:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=elevated-dev.com; s=easymail; t=1711684477; bh=W92FKKXtQLW4OvZbEe8rWKYUejxdHBmk7O/FeuYolZw=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=U2eyw+oDRxNR5ka4sfpSYX81t4eYrhATlC9Sj++t64CM1rnB549bqK24laFhDuD6S 5NGYjir9qkGuFJ0mmNpAOCnYwDbT0in7JVB4DwVB+l00xX8naPKfOe6bd3ZU4kW7qB zf1GzaGAD8kN7FdOyXQaOVsXII5xWZInvN39OI7mR9DPVSpEVt0QP2t23bM2xf4lOD IssDrjgwRrT3+W07XJFyYs8MdoGKxpffmXD4N6d4p006eujziuXucq6WUhkfLRYy/s l52qMLPXyND1VFu6ezjijJ/ttJVNDP0wRF0s/hjMYtMmX1AiXpv8GgVAxJoitLklrl pu656kDt0fvKw== X-Virus-Scanned: Debian amavisd-new at emo09-pco.easydns.vpn Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo09-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id V7_cb4CgT_KP; Fri, 29 Mar 2024 03:54:36 +0000 (UTC) Received: from smtpclient.apple (unknown [165.140.184.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id 8E0DF6E328; Fri, 29 Mar 2024 03:54:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=elevated-dev.com; s=easymail; t=1711684476; bh=W92FKKXtQLW4OvZbEe8rWKYUejxdHBmk7O/FeuYolZw=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=ntPGvy2DMYO1DMvXqB7uVl6ecvNJPgRqIOqwodgGirptkfvvmND/FRWGca+3GQXB8 sx+1DyxCv5qyQ/pyVcgJC3dn5lqbZ4qCfA1eYXtZYcJLbQ64IGHiwT1knNZZl7S0xH Gc346E5diX9uUFcVP0du4tuXNW3PfeCqedUHIbB5DS6Sv/pFnYEw0tGXGKtiGc0Jci Kz03gaQ8ZVCEfG4aJcVfFNN9SxrePSNMD5YY54NP0FaW1UOk2qTFZHDfoXRQ8RLX3g 6NDrZroGkBi/olLJmKWslAlR9XUWVtmV7RrOdrpDExXB8q+F2a0+A/2IrcNEMQ2Kjq lGJZnv5+BZIQA== Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.500.171.1.1\)) Subject: Re: Like to RETURN SQL results set From: Scott Ribe In-Reply-To: Date: Thu, 28 Mar 2024 21:54:25 -0600 Cc: "pgsql-admin@lists.postgresql.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <2ed4638d9de6042890f9b95aa596513ffe163416.camel@cybertec.at> To: M Sarwar X-Mailer: Apple Mail (2.3774.500.171.1.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Mar 28, 2024, at 9:39=E2=80=AFPM, M Sarwar = wrote: >=20 > 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=20 'select array_to_json(array_agg(row_to_json(t)))::text from (' || query = || ') as t;'