public inbox for [email protected]  
help / color / mirror / Atom feed
Read rows from a table and process - Need pointers
3+ messages / 3 participants
[nested] [flat]

* Read rows from a table and process - Need pointers
@ 2022-05-16 18:27  mahendrakar s <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: mahendrakar s @ 2022-05-16 18:27 UTC (permalink / raw)
  To: pgsql-novice <[email protected]>

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.


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Read rows from a table and process - Need pointers
@ 2022-05-17 04:05  Amul Sul <[email protected]>
  parent: mahendrakar s <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Amul Sul @ 2022-05-17 04:05 UTC (permalink / raw)
  To: mahendrakar s <[email protected]>; +Cc: pgsql-novice <[email protected]>

On Mon, May 16, 2022 at 11:57 PM mahendrakar s
<[email protected]> 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





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Read rows from a table and process - Need pointers
@ 2022-05-17 05:42  Tom Lane <[email protected]>
  parent: Amul Sul <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2022-05-17 05:42 UTC (permalink / raw)
  To: Amul Sul <[email protected]>; +Cc: mahendrakar s <[email protected]>; pgsql-novice <[email protected]>

Amul Sul <[email protected]> writes:
> On Mon, May 16, 2022 at 11:57 PM mahendrakar s
> <[email protected]> wrote:
>> 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.

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






^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2022-05-17 05:42 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-05-16 18:27 Read rows from a table and process - Need pointers mahendrakar s <[email protected]>
2022-05-17 04:05 ` Amul Sul <[email protected]>
2022-05-17 05:42   ` Tom Lane <[email protected]>

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