On 8 and 9:
gcc -g -O -Wall -Wmissing-prototypes -Wmissing-declarations -I/usr/local/include/postgresql/server -I/usr/local/include pg_filedump.c -c
In file included from pg_filedump.c:28:
pg_filedump.h:32:22: error: postgres.h: No such file or directory
On 10 and head:
gcc -g -O -Wall -Wmissing-prototypes -Wmissing-declarations -I/usr/local/include/postgresql/server -I/usr/local/include pg_filedump.c -c
make[1]: exec(gcc) failed (No such file or directory)
*** Error code 1
Reported by: pkg-fallout since august 2013
With hat: portmgr