Re: [GENERAL] Accessiing database from inside of postgresql C function - Mailing list pgsql-general

From Tom Lane
Subject Re: [GENERAL] Accessiing database from inside of postgresql C function
Date
Msg-id 6318.1504632765@sss.pgh.pa.us
Whole thread Raw
In response to [GENERAL] Accessiing database from inside of postgresql C function  (Yan Pas <yanp.bugz@gmail.com>)
List pgsql-general
Yan Pas <yanp.bugz@gmail.com> writes:
> I'm writing C postgresql module with postgresql functions and want to
> access the tables from inside (SELECT mostly and maybe INSERT). Is it
> possible? If yes what API can I use except classic TCP connection (not sure
> if it's even legal)?

Recommended way is to use SPI:
https://www.postgresql.org/docs/current/static/spi.html

Aside from that documentation, there are lots of examples to study in the
core code and contrib.

            regards, tom lane


pgsql-general by date:

Previous
From: Yan Pas
Date:
Subject: [GENERAL] Accessiing database from inside of postgresql C function
Next
From: milist ujang
Date:
Subject: [GENERAL] BDR, wal segment has been removed, is it possible move forward?