Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-interfaces by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group