If you get this error on Kali or debian based systems:
lib_postgresqludf_sys.c:34:10: fatal error: postgres.h: No such file or directory
34 | #include <postgres.h>
| ^~~~~~~~~~~~
compilation terminated.
Need to install postgres dev package.
Run the following where "XXX" is the version available to install from apt:
sudo apt-cache search postgresql-server-dev
sudo apt install postgresql-server-dev-XXX
Also run the following to locate where the file is after install
find / -name "postgres.h" -print 2>/dev/null