Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 691892E0095 for ; Tue, 10 Jun 2008 18:16:46 -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 29757-05-4 for ; Tue, 10 Jun 2008 18:16:31 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mailrelay.embarq.synacor.com (mailrelay.embarq.synacor.com [208.47.184.3]) by developer.postgresql.org (Postfix) with ESMTP id 2EC572E009E for ; Tue, 10 Jun 2008 18:16:18 -0300 (ADT) DKIM-Signature: v=1; a=rsa-sha1; d=embarqmail.com; s=s012408; c=relaxed/simple; q=dns/txt; i=@embarqmail.com; t=1213132577; h=From:Subject:Date:To:Mime-Version:Content-Type; bh=ENycUZMGI7MNCmwixfnE0YH/aXA=; b=KgmlCkkuHuqBvKAhi69OQ/6FZKCm3uluCliyUX1+Meyab7v6qu4m73qaS10V50GP MW7UBzxSXlDD7RiBncP9Gq7zOj0p9uRKP/mWtDfYzH+FWFwUPDHOnxcc0WFLkegh; X_CMAE_Category: 0,0 Undefined,Undefined X-CNFS-Analysis: v=1.0 c=1 a=yojgaC0HzEAA:10 a=gra_WR_tcWEA:10 a=eS4qYrcHAViuQOWGSToA:9 a=MA6E_u3uwfWJQGKxEFsA:7 a=bRzxAkIemrJk9eQnkW9sFLFNBREA:4 a=cvn8laQl214A:10 a=LY0hPdMaydYA:10 X-CM-Score: 0 X-Scanned-by: Cloudmark Authority Engine Authentication-Results: smtp06.embarq.synacor.com smtp.user=amsden_linux@embarqmail.com; auth=pass (LOGIN) Received: from [71.2.202.190] ([71.2.202.190:45225] helo=[192.168.0.30]) by mailrelay.embarq.synacor.com (envelope-from ) (ecelerity 2.2.1.28 r(22594)) with ESMTPA id 97/19-23327-02FEE484; Tue, 10 Jun 2008 17:16:17 -0400 Subject: Re: pqlib large object error From: Edward Amsden To: pgsql-interfaces@postgresql.org In-Reply-To: <24672.1213131983@sss.pgh.pa.us> References: <1213118594.9123.11.camel@dad-desktop2> <24672.1213131983@sss.pgh.pa.us> Content-Type: text/plain Date: Tue, 10 Jun 2008 17:16:08 -0400 Message-Id: <1213132568.15557.7.camel@dad-desktop2> Mime-Version: 1.0 X-Mailer: Evolution 2.22.2 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200806/6 X-Sequence-Number: 6749 On Tue, 2008-06-10 at 17:06 -0400, Tom Lane wrote: > 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. > It is defined as the Oid type from pqlib-fs.h > regards, tom lane