Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nqpyQ-0006F6-6R for pgsql-novice@arkaria.postgresql.org; Tue, 17 May 2022 05:42:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nqpyO-00042S-LR for pgsql-novice@arkaria.postgresql.org; Tue, 17 May 2022 05:42:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nqpyO-00042J-DB for pgsql-novice@lists.postgresql.org; Tue, 17 May 2022 05:42:20 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nqpyH-0004eJ-RJ for pgsql-novice@lists.postgresql.org; Tue, 17 May 2022 05:42:19 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 24H5gBtq1515618; Tue, 17 May 2022 01:42:11 -0400 From: Tom Lane To: Amul Sul cc: mahendrakar s , pgsql-novice Subject: Re: Read rows from a table and process - Need pointers In-reply-to: References: Comments: In-reply-to Amul Sul message dated "Tue, 17 May 2022 09:35:32 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1515616.1652766131.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 17 May 2022 01:42:11 -0400 Message-ID: <1515617.1652766131@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Amul Sul writes: > On Mon, May 16, 2022 at 11:57 PM mahendrakar s > wrote: >> I have a table test with two columns varchar and json. I need to open t= est table and read the rows (string and json object) and process them insi= de pg extension 'C' code. >> How to do this? There is table_open function in pg code but it require= s OID as input parameter. > See if table_openrv() works for you. More fundamentally, why do you want to operate at such a low level in the first place? The SPI APIs are often more fit for purpose. regards, tom lane