Florian Baumert <baumert@plt.de> writes:
> What happens is that it writes a -1 to the screen and a database-error "ERROR: lo_lseek: invalid large obj descriptor
(0)"
This needs to go into the FAQ, I think, 'cause you're about the third
person to ask the same question in the past couple weeks.
You need to wrap a transaction ("begin" ... "commit") around any use
of a large object handle, ie any lo_open ... lo_close sequence.
This requirement has always been in the LO docs, but Postgres 6.5 is the
first release that enforces the rule (by closing all open LO handles at
end of statement, if not within a transaction). In prior versions,
you could sometimes get away with not using a transaction, but it
was NOT reliable.
regards, tom lane