[email protected] (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'.

Reply via email to