Search Postgresql Archives

Re: How much data does server side "loread" return?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2021-06-24 at 15:24 +0200, Thorsten Schöning wrote:
> I need to read some large object and am wondering how much data
> "loread" returns in case it successfully reads at all AND the object
> contains at least as much data as requested.
> 
> In that case, does "loread" always return the requested amount of data
> or does one need to always loop when calling that function?

That SQL function just calls the C function lo_read, see
https://www.postgresql.org/docs/current/lo-interfaces.html#LO-READ

The documentation there says:

 "The number of bytes actually read is returned; this will be less than 'len'
  if the end of the large object is reached first. In the event of an error,
  the return value is -1."

So it will always read as many bytes as possible.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux