Markus Mehrwald <mehrwald(at)ira(dot)uka(dot)de> writes:
> I tried to insert an image in my database with lo_import. The error I
> get is "invalid large object descriptor: 0".
lo_import has to be called within a transaction block (BEGIN/COMMIT).
The documentation is not very clear about that :-(
(Actually, rather than fix the documentation we probably ought to fix
the code --- there's enough infrastructure in libpq now that it could
tell whether it needs to start its own transaction or not.)
regards, tom lane