Colm Dobbs <Colm(dot)Dobbs(at)aepona(dot)com> writes:
> Oid lobjId = lo_creat(conn, INV_READ|INV_WRITE);
> if (lobjId != -1)
This coding is wrong --- lo_creat would return 0 (InvalidOid) on
failure, not -1. As for *why* it's failing, PQerrorMessage might
offer some hint. I'm a tad surprised by that myself; never heard
of it happening with a connection not already in an error state.
regards, tom lane