Install RPostgreSQL on RHEL 6.5 libpq-fe.h Error

Serban Tanasa picture Serban Tanasa · Oct 10, 2014 · Viewed 15k times · Source

I have RHEL 6.5 Server with an installation of R (3.1.1) & RStudioServer (0.98.1062)

I have postgresql-9.3 installed and handling a large database. In order to connect R to PostgreSQL, I have in the past used the RPostgreSQL (still do on my CentOS 7 Workstation). However, attempting to compile under RHEL 6.5 I get an error

In file included from RS-PQescape.c:7:
RS-PostgreSQL.h:23:26: error: libpq-fe.h: No such file or directory

The file is located on my system here:

/usr/pgsql-9.3/include/libpq-fe.h

Libpq is part of the Postgres installation, but RPostgreSQL cannot find it:

[root@server /]# yum list libpq*
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Installed Packages
libpqxx.x86_64     1:4.0.1-1.rhel6                                               @pgdg93
libpqxx-debuginfo.x86_64     1:4.0.1-1.rhel6                                     @pgdg93
libpqxx-devel.x86_64   1:4.0.1-1.rhel6                                           @pgdg93

Is there any way to tell RPostgreSQL where to look (symbolic links?) or some other workaround? This should be simple, but I've wasted several hours on this already...

Answer

Curlew picture Curlew · Nov 27, 2014

Followup info because I just had the same problem.
Installing yum install postgresql-devel resolves the error too.