lo_open problems - Mailing list pgsql-general

From James Leigh
Subject lo_open problems
Date
Msg-id 1015278145.14587.13.camel@jacob
Whole thread Raw
Responses Re: lo_open problems
List pgsql-general
I am using some large object, but lo_open always returns -1.  I don't
know why.
Here is a code snipet (compiled with g++ for C++).

    /*
     * create the large object
     */
    Oid lobjId = lo_creat(conn, INV_READ | INV_WRITE);// works
    if (lobjId == 0){
    fprintf(stderr, "can't create large object\n");
    return 0;
    }

    int lobj_fd = lo_open(conn, lobjId, INV_WRITE);// == -1
    if(lobj_fd < 0){
    fprintf(stderr, "can't open large object (%d)\n", lobjId);
    return 0;
    }

lo_creat works and I can use psql with '\dl' to see the new lo created,
but lo_open returns '-1'.  In what cases would lo_open fail after a
successfull lo_creat?

Running the provided sample program works, so lo support is there, but
in my large application I cannot open the lo.

any ideas?
james


pgsql-general by date:

Previous
From: Fran Fabrizio
Date:
Subject: Re: storing intermediate results in recursive plpgsql functions
Next
From: Darren Ferguson
Date:
Subject: Re: libcrypt.so.2