I managed to get a c-extension to compile and run with the help of the official documentation https://www.postgresql.org/docs/13/xfunc-c.html.
Now I don't see in the examples provided a way to perform a select
inside of a c-extension. Generally I don't know where to look for documentatin of how to perform any "normal" sql-statements inside a c-extension.