Subject: Read rows from a table and process - Need pointers

From: mahendrakar s <[email-masked]>
Date: Mon, 16 May 2022 23:57:13 +0530

Hi,

I have a table test with two columns varchar and json. I need to open test
table and read the rows (string and json object) and process them inside pg
extension 'C' code.
How to do this?  There is table_open function in pg code but it requires
OID as input parameter.

Thanks,
Mahendrakar.

---

From: Amul Sul <[email-masked]>
Date: Tue, 17 May 2022 09:35:32 +0530

On Mon, May 16, 2022 at 11:57 PM mahendrakar s
<[email-masked]> wrote:
>
> Hi,
>
> I have a table test with two columns varchar and json. I need to open test table and read the rows (string and json object) and process them inside pg extension 'C' code.
> How to do this?  There is table_open function in pg code but it requires OID as input parameter.
>

See if table_openrv() works for you.

Regards,
Amul

---

From: Tom Lane <[email-masked]>
Date: Tue, 17 May 2022 01:42:11 -0400

> 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