issue with lo_lseek - it returns 4

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

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Oleg Bartunov 2009-06-17 18:46:54 Re: GiST or GIN, I feel like I am doing something wrong
Previous Message Whit Armstrong 2009-06-17 18:16:33 Re: how to cancel a query in progress