"Gregor" <gtm2(at)interia(dot)pl> writes:
> API funtions lo_open, lo_write, lo_import don't work.
You need to do lo_open/lo_write/etc inside a transaction block, because
the LO handle returned by lo_open is only good until end of transaction.
(And yes, zero is a valid handle.) See the example program in the docs:
http://www.postgresql.org/docs/8.2/static/lo-examplesect.html
and note the begin/commit commands it issues.
regards, tom lane