I've upgraded both libpq and postgresl from 7.4.x to 8.0.x and it seems like DBD-Pg isn't quite able to handle it, or I've run into a weird dependency bug. I've tried the usual stuff, and the location /usr/include/postgresql does NOT contain the requested libpq-fe.h file, it seems to be located in /usr/include/postgresql/libpq-4/ instead. It seems to me that pg_config is giving out wrong information regarding the location of include files (and possible libraries), because I had a similar problem when I tried to compile the pguuid.so custom datatype for postgresql too. Reproducible: Always Steps to Reproduce: 1. emerge libpq postgresl 2. emerge unmerge '=dev-db/libpq-7.4.8' '=dev-db/postgresql-7.4.8' 3. emerge DBD-Pg Actual Results: /usr/bin/perl5.8.6 /usr/lib/perl5/5.8.6/ExtUtils/xsubpp -typemap /usr/lib/perl5/5.8.6/ExtUtils/typemap Pg.xs > Pg.xsc && mv Pg.xsc Pg.c i686-pc-linux-gnu-gcc -c -I/usr/include/postgresql/ -I/usr/lib/perl5/vendor_perl/5.8.6/i686-linux-thread-multi/auto/DBI/ -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -mcpu=pentium3 -O3 -pipe -DVERSION=\"1.22\" -DXS_VERSION=\"1.22\" -fPIC "-I/usr/lib/perl5/5.8.6/i686-linux-thread-multi/CORE" Pg.c In file included from Pg.xs:13: Pg.h:17:22: libpq-fe.h: No such file or directory In file included from Pg.h:41, from Pg.xs:13: dbdimp.h:24: error: syntax error before "PGconn" dbdimp.h:24: warning: no semicolon at end of struct or union dbdimp.h:31: error: syntax error before '}' token dbdimp.h:37: error: syntax error before "PGresult" dbdimp.h:37: warning: no semicolon at end of struct or union dbdimp.h:50: error: syntax error before '}' token Pg.xs: In function `XS_DBD__Pg__db_commit': Pg.xs:142: error: dereferencing pointer to incomplete type Pg.xs: In function `XS_DBD__Pg__db_rollback': Pg.xs:153: error: dereferencing pointer to incomplete type Pg.xs: In function `XS_DBD__Pg__db_disconnect': Pg.xs:164: error: dereferencing pointer to incomplete type Pg.xs:168: error: dereferencing pointer to incomplete type Pg.xs:169: error: dereferencing pointer to incomplete type Pg.xs:170: error: dereferencing pointer to incomplete type Pg.xs:174: error: dereferencing pointer to incomplete type Pg.xs:174: error: dereferencing pointer to incomplete type Expected Results: Fully functional DBD-Pg, as it was working with pg 7.4.x Portage 2.0.51.22-r2 (default-linux/x86/2005.0, gcc-3.3.5-20050130, glibc-2.3.5-r0, 2.6.11.7 i686) ================================================================= System uname: 2.6.11.7 i686 Pentium III (Katmai) Gentoo Base System version 1.6.13 dev-lang/python: 2.1.3-r1, 2.2.3-r5, 2.3.5 sys-apps/sandbox: 1.2.11 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5 sys-devel/binutils: 2.15.92.0.2-r10 sys-devel/libtool: 1.5.18-r1 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-mcpu=pentium3 -O3 -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/bind /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -mcpu=i686 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks fixpackages sandbox sfperms strict" GENTOO_MIRRORS="ftp://mir.zyrianes.net/gentoo/ http://mir.zyrianes.net/gentoo/ http://ftp.linux.ee/pub/gentoo/distfiles/ http://gd.tuwien.ac.at/opsys/linux/gentoo/ ftp://ftp.du.se/pub/os/gentoo" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" USE="x86 X509 acl acpi acpi4linux alsa apache2 apm bash-completion berkdb bitmap-fonts clamav crypt cups curl doc emboss ethereal expat ext-png ext-zlib fam firebird foomaticdb freetype gd gd-external gdbm gif idea imap imlib imlib2 innodb ipv6 ithreads java jbig jce jpeg junit kerberos lcms ldap libclamav libg++ libwww lmtp ltsp mad maildir mbox mcal md5sum memlimit mikmod mmx mp3 mpeg mysql ncurses nls nptl oav odbc ogg oggvorbis pam passfile pcap pcre pdflib perl pg-vacuumdelay php png postgres ppds procmail pwdb python quicktime readline samba sasl skey slang slp snmp socks5 sox speedo sse ssl tcpd threads tiff truetype truetype-fonts type1 type1-fonts unicode vda videos vorbis winbind wmf xml xml2 xmlrpc xsl xvid zeo zlib userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS, PORTDIR_OVERLAY
Emerge sync. The DBD-Pg tree was falling behind in keyword unmasking. I've tested and used 1.43, and so have bumped to stable. Give it an hour or so to propogate to the mirrors and you should be all set.
I've tried the new version 1.43 and I still get the same error. Trying to recompile libpq and postgresql to check if it is a dependency bug. Will report back after it's finished.
Re-emerging libpq-8.0.3 and postgresql-8.0.3 and then finally re-emerging DBD-Pg-1.43 works like it should. It seems like the upgrade from postgres 7.4.x wasn't completely stable. I manually removed libpq-7.4 and postgresql-7.4 before I recompiled libpq-8 and postgresql-8, and then it seemed to work. Of course I had to recompile a whole lot of other programs too, since libpq.so.3 no longer was available (postfix, courier-mta, mod_php etc.). Revdep-rebuild -vp took care of this quite well.
good to hear :)