1

I am trying to install DBD::pg module on my linux ubuntu 12.04 machine but not able to do so. I am using download method as I am facing connectivity issues while installing it from CPAN terminal. when I run perl Makefile.PL it gives me following.

Configuring DBD::Pg 3.4.2
Path to pg_config? /vol01/local/rina/cac/softwares/pgsql
Enter a valid PostgreSQL postgres major version number 8
Enter a valid PostgreSQL postgres minor version number 8
Enter a valid PostgreSQL postgres patch version number 8
Enter a valid PostgreSQL postgres bin dir /vol01/local/rina/cac/softwares/bin  
Enter a valid PostgreSQL postgres include dir /vol01/local/rina/cac/softwares/pg_inc

I have no idea what to put in the above questions still I created few directories manually and provided as above.

then it gives me this

PostgreSQL version: 80898 (default port: 5432)
POSTGRES_HOME: (not set)
POSTPGRES_INCLUDE: /vol01/local/rina/cac/softwares/pg_inc
POSTGRES_LIB: /usr/local/pgsql/lib -lssl -lcrypto
OS: linux
Multiple copies of Driver.xst found in: /usr/local/lib64/perl5/auto/DBI/ /usr/lib64/perl5/auto/DBI/ at Makefile.PL line 182
Warning: prerequisite Time::HiRes 0 not found.
Multiple copies of Driver.xst found in: /usr/local/lib64/perl5/auto/DBI/ /usr/lib64/perl5/auto/DBI/ at Makefile.PL line 285
Using DBI 1.631 (for perl 5.010001 on x86_64-linux-thread-multi) installed in /usr/local/lib64/perl5/auto/DBI/
Writing Makefile for DBD::Pg

later when I run make it gives me below error multiple times

Pg.xs:301: error: ‘imp_dbh_t’ has no member named ‘sqlstate

How can I install this module successfully? I found few similar kind of questions but could not find the solution. Please help.

Geetika
  • 47
  • 3
  • 8
  • Is postgres installed on your system? This part of the config is setting up the postgres<=>Perl connection, so you have to find out where postgres is located. Did you run `which pg_config` (finds pg_config) or `postgres --version` to get the version of postgres? – i alarmed alien Oct 14 '14 at 10:44
  • Hi.. postgres --version gives me "postgres (PostgreSQL) 8.4.20" means it is installed...but which pg_config gives me "/usr/bin/which: no pg_config in (.:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.55.x86_64/bin:/root/bin)" – Geetika Oct 14 '14 at 11:14
  • 5
    Have you installed `libpq-dev` (`sudo apt-get install libpq-dev`)? – i alarmed alien Oct 14 '14 at 11:15
  • nope.. when I am running this command..it gives me "sudo: apt-get: command not found" – Geetika Oct 14 '14 at 11:17
  • What package management software are you using? aptitude? You need to install libpq-dev to get pg_config – i alarmed alien Oct 14 '14 at 11:17
  • ohhkk.. could you please help me know..how to install apt-get package? – Geetika Oct 14 '14 at 11:22
  • Impossible to do remotely. Have a read of the [Ubuntu package management docs](https://help.ubuntu.com/12.04/serverguide/package-management.html). – i alarmed alien Oct 14 '14 at 11:49
  • thanks for help..one more query I have one more test server which is centOS even this doesn't have pg_config...is it possible to install on centOS server? so that I can proceed with this server? – Geetika Oct 14 '14 at 11:56
  • 2
    hi..I did it on centOS machine...I ran "yum install postgresql-devel" and then installed the module successfully...thanks a lot for your time and help... :) – Geetika Oct 14 '14 at 12:10
  • @Geetika maybe you should post your own solution as an answer below, so you can accept it. – tobyink Oct 14 '14 at 15:03
  • @tobyink this Q was off-topic for SO -- it's really a package installation problem, rather than a programming question. – i alarmed alien Oct 14 '14 at 15:19

1 Answers1

1

Solved in the comments by Geetika:

I did it on centOS machine...I ran "yum install postgresql-devel" and then installed the module successfully...thanks a lot for your time and help... :)

Miller
  • 34,962
  • 4
  • 39
  • 60