Re: [INTERFACES] Postgresql + lo

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Florian Baumert <baumert(at)plt(dot)de>
Cc: pgsql-interfaces(at)postgreSQL(dot)org
Subject: Re: [INTERFACES] Postgresql + lo
Date: 1999-07-09 01:16:14
Message-ID: 1300.931482974@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Florian Baumert <baumert(at)plt(dot)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

Browse pgsql-interfaces by date

  From Date Subject
Next Message Tom Lane 1999-07-09 01:20:58 Re: [INTERFACES] transactions in libpq++ require new connection?
Previous Message Geoffrey C. Speicher 1999-07-08 22:25:13 Re: [INTERFACES] libpq AND C++ Builder