Re: issue with lo_lseek - it returns 4

From: Konstantin Izmailov <pgfizm(at)gmail(dot)com>
To: Konstantin Izmailov <kizmailov(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: issue with lo_lseek - it returns 4
Date: 2009-06-17 22:18:56
Message-ID: 72746b5e0906171518r4918790ep7895d3d19ab199e6@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Out of curiosity, what if lo object has size > 4GB, how lo_tell return its
size? Looks like this is an interface issue.

I found a post dated back to 1998, when somebody pointed it out and a
posgres developer promised to fix it.

Thank you all

On Wed, Jun 17, 2009 at 3:15 PM, Konstantin Izmailov <pgfizm(at)gmail(dot)com>wrote:

> I found the reason - it was bug in my code when inserting lo object. It's
> size was actually 4.
> Please ignore or delete my post.
>
> On Wed, Jun 17, 2009 at 11:38 AM, Konstantin Izmailov <
> kizmailov(at)gmail(dot)com> wrote:
>
>> Hi,
>> I'm trying to get lo size via libpq before starting reading it (postgres
>> server 8.3.5). lo_lseek always returns 4 (actual size is > 1M).
>> I query table with "select photo from employee where id='xxxx'". It
>> returns lo oid integer as expected. Then I use following code to obtain size
>> of the lo object:
>> int lobj_fd = lo_open(conn, lobjId, INV_READ); // returns valid fd,
>> ok
>>
>> lo_lseek(conn, lobj_fd, 0L, SEEK_END );
>> size = lo_tell(conn, lobj_fd); // always returns 4, error?
>>
>> Is it possible to obtain lo object size before reading it?
>>
>> Thank you
>> Konstantin
>>
>>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-06-17 22:19:56 Re: how to cancel a query in progress
Previous Message Konstantin Izmailov 2009-06-17 22:15:03 Re: issue with lo_lseek - it returns 4