Ubuntuでは、ヘッダーがlibpq-devの一部であるように見えます パッケージ(少なくとも次のUbuntuバージョンでは:11.04(Natty Narwhal)、10.04(Lucid Lynx)、11.10(Oneiric Ocelot)、12.04(Precise Pangolin)、14.04(Trusty Tahr)、18.04(Bionic Beaver)):
...
/usr/include/postgresql/libpq-fe.h
...
したがって、libpq-devをインストールしてみてください またはお使いのOSに相当するもの:
- Ubuntu / Debianシステムの場合:
sudo apt-get install libpq-dev - Red Hat Linux(RHEL)システムの場合:
yum install postgresql-devel - Mac Homebrewの場合:
brew install postgresql - Mac MacPorts PostgreSQLの場合:
gem install pg -- --with-pg-config=/opt/local/lib/postgresql[version number]/bin/pg_config - OpenSuseの場合:
zypper in postgresql-devel - ArchLinuxの場合:
pacman -S postgresql-libs