pqlib large object error - Mailing list pgsql-interfaces

From Edward Amsden
Subject pqlib large object error
Date
Msg-id 1213118594.9123.11.camel@dad-desktop2
Whole thread Raw
Responses Re: pqlib large object error
Re: pqlib large object error
List 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
unusedOID?
 

Thanks,
Edward



pgsql-interfaces by date:

Previous
From: "Jonah H. Harris"
Date:
Subject: Re: Newbie problem with from database in C
Next
From: Tom Lane
Date:
Subject: Re: pqlib large object error