Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 9796A2E0040 for ; Tue, 10 Jun 2008 18:06:31 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 16441-06 for ; Tue, 10 Jun 2008 18:06:24 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by developer.postgresql.org (Postfix) with ESMTP id 12F092E003E for ; Tue, 10 Jun 2008 18:06:24 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m5AL6NwH024673; Tue, 10 Jun 2008 17:06:23 -0400 (EDT) To: Edward Amsden cc: pgsql-interfaces@postgresql.org Subject: Re: pqlib large object error In-reply-to: <1213118594.9123.11.camel@dad-desktop2> References: <1213118594.9123.11.camel@dad-desktop2> Comments: In-reply-to Edward Amsden message dated "Tue, 10 Jun 2008 13:23:14 -0400" Date: Tue, 10 Jun 2008 17:06:23 -0400 Message-ID: <24672.1213131983@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200806/5 X-Sequence-Number: 6748 Edward Amsden 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