Received: from sss.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2] (may be forged)) by hub.org (8.9.3/8.9.3) with ESMTP id JAA84151 for ; Fri, 23 Jul 1999 09:58:09 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.sss.pgh.pa.us (8.9.1/8.9.1) with ESMTP id JAA14400; Fri, 23 Jul 1999 09:57:30 -0400 (EDT) To: Florian Baumert cc: pgsql-interfaces@postgreSQL.org Subject: Re: [INTERFACES] Postgresql + lo In-reply-to: Your message of Fri, 9 Jul 1999 00:19:51 +0200 <1913.990709@plt.de> Date: Fri, 23 Jul 1999 09:57:30 -0400 Message-ID: <14398.932738250@sss.pgh.pa.us> From: Tom Lane Florian Baumert writes: > What happens is that it writes a -1 to the screen and a database-error > "ERROR: lo_lseek: invalid large obj descriptor (0)" You need "begin transaction"/"end transaction" around the use of the LO handle (ie, surrounding lo_open ... lo_close). The documentation has always stated that lo_open must be wrapped in a transaction, but Postgres versions before 6.5 didn't enforce that rule. (Instead, they'd just fail occasionally if you broke it :-(.) 6.5 enforces the rule by auto-closing LO handles at transaction commit --- which will be instantly upon completion of the lo_open command, if you are not inside a transaction; so the first attempt to do anything with the handle will draw "invalid large obj descriptor". This is definitely getting to be a FAQ... regards, tom lane