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