Vincent Roberts <vroberts@emanon.net> writes:
> I notice that the lo_create and lo_open functions require a postgres
> connection (PGConn)
Those are the client-side functions; naturally they need a connection
to the backend. For the server-side functions, look in
src/backend/libpq/be-fsstubs.c. For that matter, since you seemingly
don't need to hold an open LO reference except within your function,
you might find it easiest to work directly with the underlying
inv_create &etc layer of functions. See lo_export and lo_import in
be-fsstubs.c for inspiration.
regards, tom lane