Re: [INTERFACES] Postgresql + lo - Mailing list pgsql-interfaces

From Tom Lane
Subject Re: [INTERFACES] Postgresql + lo
Date
Msg-id 1300.931482974@sss.pgh.pa.us
Whole thread Raw
In response to Postgresql + lo  (Florian Baumert <baumert@plt.de>)
List pgsql-interfaces
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


pgsql-interfaces by date:

Previous
From: seb@Panther4095.eiu.edu
Date:
Subject: NEW WEB INTERFACE for PostgreSQL
Next
From: Tom Lane
Date:
Subject: Re: [INTERFACES] transactions in libpq++ require new connection?