65

In order to develop one web application based on postgresql, i need to install libpq on my centos.

I can install it by "apt-get install libpq-dev" on ubuntu, but i can not install it on centos by "yum install libpq".

Who can tell me how to install it, thanks!

larry
  • 4,217

4 Answers4

96

I just had to install this on my CentOS 6 server since psycopg2 required pg_config. Boo yah:

yum install postgresql-devel

Update

If you still encounter issues with pg_config, you may need to add it to your PATH, e.g.:

export PATH=$PATH:/usr/pgsql-x.x/bin

where x.x is your version, such as /usr/pgsql-9.2./bin.

Banjer
  • 4,093
63

The package is called postgresql-libs on Red Hat and derived distributions.

7

It is libpqxx:

Name       : libpqxx-devel
Arch       : x86_64
Version    : 2.6.9
Release    : 3.el5.rf
Size       : 1.4 M
Repo       : rpmforge
Summary    : Header files, libraries and development documentation for libpqxx.
URL        : http://pqxx.org/
License    : BSD
Description: This package contains the header files, static libraries and development
           : documentation for libpqxx. If you like to develop programs using libpqxx,
           : you will need to install libpqxx-devel.

You can install it from rpmforge or epel repo:

# yum install libpqxx-devel
quanta
  • 52,423
0

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/