Re: libpg: large object problems - Mailing list pgsql-novice

From greg@turnstep.com
Subject Re: libpg: large object problems
Date
Msg-id 570ec88aa821ca84989b8d68cfad9146@biglumber.com
Whole thread Raw
In response to libpg: large object problems  (Seth Nickell <snickell@stanford.edu>)
Responses Re: libpg: large object problems
List pgsql-novice
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


> I'm trying to figure out how to get large objects working using libpg.
> The problem is that whenever I do an lo_open on an object, I get back
> "-1" as the file descriptor (and of course, an lo_read on that fails).

Large object operations must be done within a transaction. Try issuing
a "begin" before you call lo_creat:

res = PQexec(dbConn, "begin");
PQclear(res);

// Large object stuff goes here....

res = PQexec(dbConn, "end");
PQclear(res);
PQfinish(dbConn);


- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200305030957
-----BEGIN PGP SIGNATURE-----
Comment: http://www.turnstep.com/pgp.html

iD8DBQE+s8tnvJuQZxSWSsgRAog6AKCAmVAsn0SF8mnrKQiVp+7SdxTZSQCfWvUf
op+BcWSQCJIwyVJ72J8+KUA=
=HMkb
-----END PGP SIGNATURE-----


pgsql-novice by date:

Previous
From: Seth Nickell
Date:
Subject: libpg: large object problems
Next
From: "Israel Calderon"
Date:
Subject: Error Uninstalling 7.2.2 on Mandrake 9.0