I wrote a C function to be executed from within PostgreSQL (with a CREATE FUNCTION ... LANGUAGE C;
command) but when I do so, it responds 'PQnfields: symbol not found'.
I tried to include the path to where the libpq library is when I compile, like this:
gcc -lpq -fpic -c crossdb.c -I`pg_config --includedir-server` -I /usr/include/ -std=c99
But it didn't work. I think that it is simply not possible to use libpq to query the database from a function... So if you know how to do it or what is causing this error message, I'd be happy to ear it from you.