configure: error: libpq is not installed or libpq is old

6.2k views Asked by At

I'm trying to install pgpool-II in Ubuntu 13.10 environment. I'm following this tutorial to get it done.

I get below error.

configure: error: libpq is not installed or libpq is old

From the docs.

Note: pgpool-II requires libpq library in PostgreSQL 7.4 or later (version 3 protocol). If configure script displays the following error message, libpq library may not be installed, or it is not of version 3.

configure: error: libpq is not installed or libpq is old

If the library is version 3, but above message is still displayed, your libpq library is probably not recognized by configure script.

configure script searches for libpq library under /usr/local/pgsql libaray. If you have installed PostgreSQL to a directory other than /usr/local/pgsql, use --with-pgsql, or --with-pgsql-includedir and --with-pgsql-libdir command line options when you execute configure.

I'm using below command to fix it as instructed but it does not work.

./configure --with-pgsql-includedir /usr/lib/

I also followed this from Database Administrators Stack Exchange too.

How can I fix this?

5

There are 5 answers

0
Daniel Vérité On BEST ANSWER

When compiling programs that require libpq, the Ubuntu package that must be installed is libpq-dev.


That being said, concerning pgpool II, it doesn't need to be compiled from source because it's available as a package in the main repository:

$ apt-cache search pgpool2
pgpool2 - connection pool server and replication proxy for PostgreSQL

so it would be easier to run

sudo apt-get install pgpool2

to install the package.

0
Techie On

I got the answer.

./configure --with-pgsql-includedir=/usr/bin/
0
evergreen On

1 - If that alone doesn't do the trick, try making sure pg_config is on the PATH:

export PATH=$PATH:/usr/pgsql-[version]/bin

2- > ./configure

0
Harsh.K On

Got same error (error: libpq is not installed or libpq is old) on fedora while trying to configure pgpool by executing ./configure

It gets solved by installing postgres development package which has libpq as its dependency.

For fedora : dnf install postgresql-devel

Use your system pacakge manage to install postgres-devel

0
Shawn ZHONG On

I find the main reason, it is because we lack of some information. if the postgresql was installed with YUM. confirm that the /usr/pgsql-[version]/lib/ /usr/pgsql-[version]/include/ /usr/pgsql-[version]/bin/ are exists in your server

yum install postgresql10-server postgresql10-devel postgresql10-libs -y

then

./configure --prefix=/opt/pgpool-II/ --with-pgsql=/usr/pgsql-10/bin/ --with-pgsql-includedir=/usr/pgsql-10/include --with-pgsql-libdir=/usr/pgsql-10/lib