I ran into this same problem. I think some of the source of the confusion is
that the perl5 interface documentation do not mention any such restriction.
--
Jeremy Bettis
jeremy(at)hksys(dot)com
> 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 :-(.)