Re: [BUGS] Large Object

From: Peter T Mount <pgbugs(at)maidast(dot)demon(dot)co(dot)uk>
To: ChulSu Park <pcs(at)bmail(dot)kek(dot)jp>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: [BUGS] Large Object
Date: 1998-04-28 06:00:46
Message-ID: Pine.LNX.3.95.980428065847.5775A-100000@retep.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

[ moved to interfaces ]

On Tue, 28 Apr 1998, ChulSu Park wrote:

> Hello,
>
> Can anyone answer?
>
> (1) when I run the test/example/testlo.c, comment out "exit(0)" at the
> end of the main, it segfaulted on redhat5.0 linux(and libpq++ examples
> also). Then Do I have to call "exit" function always? not usual return
> 0; ?
>
> (2) How can I get the size(length) of the large object? When I try
> lo_open
> size1 = lo_lseek to SEEK_END
> or
> size2 = lo_tell
> size gives me -1 for big large object(it worked for small large
> object). So I browsed the libpq sources, in fe-lobj.c there was comment
> something like this
> ... only L_SET is implemented... then how can I get the saved large
> object size?
> impossible?

The way I implemented it in the JDBC driver was (similar to):

long tmp = lo_seek to SEEK_END
long size = lo_tell
lo_seek to tmp

I tested this on objects ranging from 512 bytes to 2Mb.

--
Peter T Mount peter(at)retep(dot)org(dot)uk or petermount(at)earthling(dot)net
Main Homepage: http://www.demon.co.uk/finder (moving soon to www.retep.org.uk)
************ Someday I may rebuild this signature completely ;-) ************
Work Homepage: http://www.maidstone.gov.uk Work EMail: peter(at)maidstone(dot)gov(dot)uk

Browse pgsql-interfaces by date

  From Date Subject
Next Message Stephen Davies 1998-04-28 07:06:01 Re: [INTERFACES] New Driver
Previous Message Peter T Mount 1998-04-28 05:36:51 Re: [HACKERS] Re: [INTERFACES] retrieving varchar size