Re: Binary large object processing problems

From: Raivo Rebane <raivore55(at)gmail(dot)com>
To: Christoph Moench-Tegeder <cmt(at)burggraben(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Binary large object processing problems
Date: 2023-03-13 15:54:04
Message-ID: CAMH5fpvvmFzJvV=QZBB2Ny4zKyNUzj2POswsbXpw+_o7-ecupQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thank for answer, but I was also readed this manual and found there :
35.3.2. Importing a Large Object

To import an operating system file as a large object, call

Oid lo_import(PGconn *conn, const char *filename);

*filename* specifies the operating system name of the file to be imported
as a large object. The return value is the OID that was assigned to the new
large object, or InvalidOid (zero) on failure. Note that the file is read
by the client interface library, not by the server; so it must exist in the
client file system and be readable by the client application.
This file what I want to import is readable, I just tested it. So I
expected that lo_import doesn't work properly. It answers to my - invalid
large-object descriptor: 0
why ?

I try now by creating, opening, writing and closing sequence or are there
alternatives ?

Regards
Raivo

On Mon, Mar 13, 2023 at 5:26 PM Christoph Moench-Tegeder <cmt(at)burggraben(dot)net>
wrote:

> ## Raivo Rebane (raivore55(at)gmail(dot)com):
>
> > Can anybody help me find where is my mistake an what is working solution
> ?
>
> The documentation clearly states "All large object manipulation using
> these functions must take place within an SQL transaction block"
> https://www.postgresql.org/docs/current/lo-interfaces.html
> but I couldn't see anything of thank kind in your code.
>
> Regards,
> Christoph
>
> --
> Spare Space.
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2023-03-13 16:18:27 Re: Binary large object processing problems
Previous Message Christoph Moench-Tegeder 2023-03-13 15:26:40 Re: Binary large object processing problems