In CentOS, for source files that compiled correctly in Ubuntu
sudo yum install libpq-devel
or
sudo yum install postgresql-devel
Then copy libpq-fe.h from /usr/include/ to /usr/include/postgresql/