Re: BUG #2823: API largeobject calls - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #2823: API largeobject calls
Date
Msg-id 21351.1165885102@sss.pgh.pa.us
Whole thread Raw
In response to BUG #2823: API largeobject calls  ("Gregor" <gtm2@interia.pl>)
List pgsql-bugs
"Gregor" <gtm2@interia.pl> writes:
> API funtions lo_open, lo_write, lo_import don't work.

You need to do lo_open/lo_write/etc inside a transaction block, because
the LO handle returned by lo_open is only good until end of transaction.
(And yes, zero is a valid handle.)  See the example program in the docs:
http://www.postgresql.org/docs/8.2/static/lo-examplesect.html
and note the begin/commit commands it issues.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Milen A. Radev"
Date:
Subject: Re: GRANT RULE IN 8.2
Next
From: "J. Greg Davidson"
Date:
Subject: SPI_getvalue calls output function w/o pushing existing SPI connection + 2 extra issues