pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Florian Baumert <baumert@plt.de>
Cc: pgsql-interfaces@postgreSQL.org
Subject: Re: [INTERFACES] Postgresql + lo
Date: Fri, 23 Jul 1999 09:57:30 -0400
Message-ID: <14398.932738250@sss.pgh.pa.us> (raw)
In-Reply-To: <1913.990709@plt.de>

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)"

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



view thread (4+ messages)  latest in thread

Message-ID: <14398.932738250@sss.pgh.pa.us>
Permalink:  ../14398.932738250@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/14398.932738250@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: tgl@sss.pgh.pa.us, baumert@plt.de
  Subject: Re: [INTERFACES] Postgresql + lo
  In-Reply-To: <14398.932738250@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox