FAQ
Having problems compiling DBD::Pg on a RHEL 5.5 machine running Perl 5.8.8
running Greenplum which is based on PostgreSQL 8.2.15.

[root@mdw DBD-Pg-2.19.3]# perl Makefile.PL

Configuring DBD::Pg 2.19.3

CONFIGURE value not available

PostgreSQL version: 80215 (default port: 5432)

POSTGRES_HOME: (not set)

POSTGRES_INCLUDE: /usr/local/GP-4.2.4.0/include

POSTGRES_LIB: /usr/local/GP-4.2.4.0/lib

OS: linux

Using DBI 1.52 (for perl 5.008008 on x86_64-linux-thread-multi) installed
in /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/auto/DBI/

Writing Makefile for DBD::Pg

Writing MYMETA.yml and MYMETA.json

[root@mdw DBD-Pg-2.19.3]#

[root@mdw DBD-Pg-2.19.3]# make

Skip blib/lib/DBD/testme.tmp.pl (unchanged)

Skip blib/lib/Bundle/DBD/Pg.pm (unchanged)

Skip blib/lib/DBD/Pg.pm (unchanged)

gcc -c -I/usr/local/GP-4.2.4.0/include
-I/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/auto/DBI
-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe
-Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -DPGLIBVERSION=80215
-DPGDEFPORT=5432 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic
-DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree
-Drealloc=Perl_realloc -Dcalloc=Perl_calloc -DVERSION=\"2.19.3\"
-DXS_VERSION=\"2.19.3\" -fPIC
"-I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE" Pg.c

gcc -c -I/usr/local/GP-4.2.4.0/include
-I/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/auto/DBI
-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe
-Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -DPGLIBVERSION=80215
-DPGDEFPORT=5432 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic
-DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree
-Drealloc=Perl_realloc -Dcalloc=Perl_calloc -DVERSION=\"2.19.3\"
-DXS_VERSION=\"2.19.3\" -fPIC
"-I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE" dbdimp.c

dbdimp.c:55: error: conflicting types for ‘lo_import_with_oid’

/usr/local/GP-4.2.4.0/include/libpq-fe.h:533: error: previous declaration
of ‘lo_import_with_oid’ was here

dbdimp.c:56: error: conflicting types for ‘lo_import_with_oid’

/usr/local/GP-4.2.4.0/include/libpq-fe.h:533: error: previous declaration
of ‘lo_import_with_oid’ was here

dbdimp.c: In function ‘pg_st_prepare_statement’:

dbdimp.c:2178: warning: comparison is always false due to limited range of
data type

dbdimp.c: In function ‘pg_st_execute’:

dbdimp.c:3036: warning: comparison is always false due to limited range of
data type

dbdimp.c:3046: warning: comparison is always false due to limited range of
data type

dbdimp.c:3047: warning: comparison is always false due to limited range of
data type

dbdimp.c:3186: warning: comparison is always false due to limited range of
data type

dbdimp.c: In function ‘pg_st_fetch’:

dbdimp.c:3414: warning: comparison is always false due to limited range of
data type
make: *** [dbdimp.o] Error 1

Thanks,

Jon

Search Discussions

  • Rainer Weikusat at Aug 29, 2013 at 4:49 pm

    Jon Ernster writes:
    Having problems compiling DBD::Pg on a RHEL 5.5 machine running Perl 5.8.8
    running Greenplum which is based on PostgreSQL 8.2.15. [...]
    dbdimp.c:55: error: conflicting types for ‘lo_import_with_oid’

    /usr/local/GP-4.2.4.0/include/libpq-fe.h:533: error: previous declaration
    of ‘lo_import_with_oid’ was here

    dbdimp.c:56: error: conflicting types for ‘lo_import_with_oid’

    /usr/local/GP-4.2.4.0/include/libpq-fe.h:533: error: previous declaration
    of ‘lo_import_with_oid’ was here
    That's caused by the following dbdimp.c section:

    #if PGLIBVERSION < 80400

    Oid lo_import_with_oid (PGconn *conn, char *filename, unsigned int lobjId);
    Oid lo_import_with_oid (PGconn *conn, char *filename, unsigned int lobjId) {
             croak ("Cannot use lo_import_with_oid unless compiled against Postgres 8.4 or later");
    }

    #endif

    According to

    http://git.postgresql.org/gitweb/?p=postgresql.git;a=blobdiff;f=src/interfaces/libpq/libpq-fe.h;h=53d79b059f6228083cc397436c4d3e732e4c1357;hp=f51c6b38acdcdd2da4fe17f14cc601dc918bbc77;hb=8436f9a0364a6a16dbf7b250597986a97c9e6f09;hpb=f755f2fef39504d85b22233988b5ce8216f6edd7

    the correct prototype is

    Oid lo_import_with_oid(PGconn *conn, const char *filename, Oid lobjId);

    but since your libpq-fe has this this interface, you might not want to
    disable it. A "quick and dirty" fix would be to delete the ifdef
    block. A better idea might be to change the condition such that the
    code won't be compiled for your server version, eg, by examining some
    'vendor specific macro'.
  • Greg Sabino Mullane at Aug 31, 2013 at 2:54 am

    PostgreSQL version: 80215 (default port: 5432) ...
    /usr/local/GP-4.2.4.0/include/libpq-fe.h:533: error:
    previous declaration of 'lo_import_with_oid' was here
    Something is very wrong here. Version 8.2 (old and unsupported,
    FWIW) had no concept of lo_import_with_oid, so you have a
    more modern libpq-fe header file there, which will cause
    all sorts of problems beyond the function at hand. See if you
    can find out where the 8.2 libpq libraries are, and point things
    there via the ENV variables mentioned in the README file.

    - --
    Greg Sabino Mullane greg@endpoint.com greg@turnstep.com
    End Point Corporation 610-983-9073
    PGP Key: 0x14964AC8 201308302253
    http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
  • Rainer Weikusat at Aug 31, 2013 at 3:01 pm

    "Greg Sabino Mullane" writes:
    PostgreSQL version: 80215 (default port: 5432) ...
    /usr/local/GP-4.2.4.0/include/libpq-fe.h:533: error:
    previous declaration of 'lo_import_with_oid' was here
    Something is very wrong here. Version 8.2 (old and unsupported,
    FWIW) had no concept of lo_import_with_oid, so you have a
    more modern libpq-fe header file there, which will cause
    all sorts of problems beyond the function at hand.
    He is using a postgres fork (something called 'Greenplum' aka
    'GP'). This documents itself as

      Greenplum Database is based on PostgreSQL 8.2 with a few
      features added in from the 8.3 release.

    and when the libpq-fe.he which came with this database has the
    prototype for lo_import_with_oid, chances are that the corresponding
    library has it as well (nm -D ... | grep lo_import could be used to
    check this).

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdbd-pg @
categoriesperl
postedAug 28, '13 at 7:56p
activeAug 31, '13 at 3:01p
posts4
users3
websiteperl.org

People

Translate

site design / logo © 2022 Grokbase