Re: pqlib large object error - Mailing list pgsql-interfaces

From Edward Amsden
Subject Re: pqlib large object error
Date
Msg-id 1213132568.15557.7.camel@dad-desktop2
Whole thread Raw
In response to Re: pqlib large object error  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pqlib large object error  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-interfaces
On Tue, 2008-06-10 at 17:06 -0400, Tom Lane wrote:
> Edward Amsden <amsden_linux@embarqmail.com> writes:
> > I am using the following code to create the large object:
> >         lo_1 =  lo_creat(connect1, INV_READ|INV_WRITE);
> >         if (lo_1 > 0) {
> >             ... (open and write)
> >         } else {
> >             fprintf (stderr, "Unable to create large object: %s\n", PQerrorMessage(connect1));
> >         }
> 
> BTW, what type do you have lo_1 declared as?  It strikes me that if it's
> signed int32, and your OID counter is past 2 billion, this code would
> fail because it would misinterpret a valid OID as negative.  The printf
> would then report whatever the last error on the connection had been.
> This still wouldn't explain why you're getting the duplicate-key error,
> but it might at least point to the proper place to look.
> 
It is defined as the Oid type from pqlib-fs.h
>             regards, tom lane



pgsql-interfaces by date:

Previous
From: Tom Lane
Date:
Subject: Re: pqlib large object error
Next
From: Tom Lane
Date:
Subject: Re: pqlib large object error