Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id E428B2E0031 for ; Tue, 10 Jun 2008 14:43:28 -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 04314-03 for ; Tue, 10 Jun 2008 14:43:21 -0300 (ADT) X-Greylist: delayed 00:20:00.381187 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 855412E002E for ; Tue, 10 Jun 2008 14:43:22 -0300 (ADT) DKIM-Signature: v=1; a=rsa-sha1; d=embarqmail.com; s=s012408; c=relaxed/simple; q=dns/txt; i=@embarqmail.com; t=1213118600; h=From:Subject:Date:To:Mime-Version:Content-Type; bh=FzJl92noi/V4Y/wXjwuIaIFyE/o=; b=Mb5iykm3+J/yzXPQ9ijJRrWDdtJHaMaVcZdM/n23bEIQ/F4jHb45CwDimMhFKnRv IZxPN/H+RCgjtT2LEIesUz/aNWxObWfKkXsQGuP95t990tU7FI7iTgBl/yjrEv2A; X_CMAE_Category: 0,0 Undefined,Undefined X-CNFS-Analysis: v=1.0 c=1 a=nCDaYMEstVHBom7CsR0A:9 a=In0Mow0UvjZgkRfOFWAmGYTypjQA:4 a=gi0PWCVxevcA:10 X-CM-Score: 0 X-Scanned-by: Cloudmark Authority Engine Authentication-Results: smtp07.embarq.synacor.com smtp.user=amsden_linux@embarqmail.com; auth=pass (LOGIN) Received: from [71.2.202.190] ([71.2.202.190:46914] helo=[192.168.0.30]) by mailrelay.embarq.synacor.com (envelope-from ) (ecelerity 2.2.1.28 r(22594)) with ESMTPA id 8F/1F-06326-788BE484; Tue, 10 Jun 2008 13:23:20 -0400 Subject: pqlib large object error From: Edward Amsden To: pgsql-interfaces@postgresql.org Content-Type: text/plain Date: Tue, 10 Jun 2008 13:23:14 -0400 Message-Id: <1213118594.9123.11.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-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200806/1 X-Sequence-Number: 6744 I am writing some proof-of-concept code for a project which involves using PostgreSQL's large object facility to store audio data. Currently, the goal for this code is to test the performance of reading audio data from a file and writing it to a large object. I am learning as I go, but I cannot seem to figure this error message out: ERROR: duplicate key value violates unique constraint "pg_largeobject_loid_pn_index" 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)); } where connect1 is the pointer to my connection. Why is there a duplicate key if lo_creat() is supposed to assign an unused OID? Thanks, Edward