RPostgres install error on RHEL 6

package-installation
#1

Hi,
I am trying to install RPostgres package on R3.5 and it throws below error:(My OS is RHEL 6)

g++  -I"/opt/R/3.5.0/lib64/R/include" -DNDEBUG  -I"/opt/R/3.5.0/lib64/R/library/BH/include" -I"/opt/R/3.5.0/lib64/R/library/plogr/include" -I"/opt/R/3.5.0/lib64/R/library/Rcpp/include" -I/usr/local/include   -fpic  -g -O2  -c DbConnection.cpp -o DbConnection.o
DbConnection.cpp: In constructor ‘DbConnection::DbConnection(std::vector<std::basic_string<char> >, std::vector<std::basic_string<char> >)’:
DbConnection.cpp:21:61: error: ‘PQconnectdbParams’ was not declared in this scope
   pConn_ = PQconnectdbParams(&c_keys[0], &c_values[0], false);
                                                             ^
DbConnection.cpp: In member function ‘SEXPREC* DbConnection::quote_string(const Rcpp::String&)’:
DbConnection.cpp:195:86: error: ‘PQescapeLiteral’ was not declared in this scope
   char* pq_escaped = PQescapeLiteral(pConn_, x.get_cstring(), static_cast<size_t>(-1));
                                                                                      ^
DbConnection.cpp: In member function ‘SEXPREC* DbConnection::quote_identifier(const Rcpp::String&)’:
DbConnection.cpp:206:89: error: ‘PQescapeIdentifier’ was not declared in this scope
   char* pq_escaped = PQescapeIdentifier(pConn_, x.get_cstring(), static_cast<size_t>(-1));
                                                                                         ^
make: *** [DbConnection.o] Error 1
ERROR: compilation failed for package ‘RPostgres’
0 Likes

#2

How did you install Postgres client? RHEL 6.x is very old and if you just used postres-devel rpm, you got the version which is not compatible with RPostgres. See here https://stackoverflow.com/questions/29686258/pqconnectdbparams-was-not-declared-in-this-scope.

0 Likes

#3

Correct, the version from postgre-devel is not compatible with rpostgres. So I tried to setup binaries available in PostgreS site; I am not sure if this was the right way however it did throw a different error.

Do we have any option on Rhel 6 to configure RPostgres package?

0 Likes