Re: libpg: large object problems

From: greg(at)turnstep(dot)com
To: pgsql-novice(at)postgresql(dot)org
Cc: snickell(at)stanford(dot)edu
Subject: Re: libpg: large object problems
Date: 2003-05-03 14:00:46
Message-ID: 570ec88aa821ca84989b8d68cfad9146@biglumber.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)turnstep(dot)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-----

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Israel Calderon 2003-05-03 19:20:19 Error Uninstalling 7.2.2 on Mandrake 9.0
Previous Message Seth Nickell 2003-05-03 03:50:46 libpg: large object problems