Re: pqlib large object error

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Edward Amsden <amsden_linux(at)embarqmail(dot)com>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: pqlib large object error
Date: 2008-06-10 21:06:23
Message-ID: 24672.1213131983@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Edward Amsden <amsden_linux(at)embarqmail(dot)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.

regards, tom lane

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Edward Amsden 2008-06-10 21:16:08 Re: pqlib large object error
Previous Message Tom Lane 2008-06-10 20:49:56 Re: pqlib large object error