pqlib large object error

From: Edward Amsden <amsden_linux(at)embarqmail(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: pqlib large object error
Date: 2008-06-10 17:23:14
Message-ID: 1213118594.9123.11.camel@dad-desktop2
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

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

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Tom Lane 2008-06-10 18:29:53 Re: pqlib large object error
Previous Message Jonah H. Harris 2008-05-20 13:36:03 Re: Newbie problem with from database in C