I am developing a postgres extension. The extension gets json data as a string from external source and is supposed to be able to store this string in a Jsonb type.
I am working with C API for postgres-9.4 installed from ubuntu trusty main repo.
I would like to use a function that converts a cstring to Jsonb* structure defined in
Namely, the function Datum jsonb_in ( PG_FUNCTION_ARGS ), however I am not sure if I can call this function from C API in a portable and safe manner. As it seems it is intended for being called by postgres from first glance.
but it is declared and defined in jsonb.c and not declared in json.h, and hence linking with this function is not a very clean solution. I tried finding the symbols for jsonb_from_cstring in libpq.so, however there are none. I am guessing I need a non-standard build of postgres?
So the question is, what is the best way to convert a cstring to a Jsonb* structure from within C API?