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

Re: Why am I getting the error: "Cannot insert a duplicate key into unique index"?

From: paul(at)entropia(dot)co(dot)uk
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Why am I getting the error: "Cannot insert a duplicate key into unique index"?
Date: 2004-09-08 14:16:46
Message-ID: 413F225E.17879.5E656F9@localhost (view raw or flat)
Thread:
Lists: pgsql-novice
You are trying to insert a value into a column that is declared as unique,
this value must already be in the column so pg rejects it.

> 
> Hi,
> 
> I'm using PostgreSQL 7.3.4 on phpPgAdmin 2.4.2 and I'm getting the following error when 
> I try and run a SQL query on a script:
> 
> Error - /usr/local/psa/admin/htdocs/domains/databases/phpPgAdmin/db_readdump.php -- 
> Line: 33 
> PostgreSQL said: ERROR: Cannot insert a duplicate key into unique index 
> inventory_pkey
> Your query: 
> INSERT INTO "inventory" 
> ("code","quantity","id","description","price","category","image","file","date","uid","sub_t
> ype1","sub_type2","sub_type3","title","gst","gauge") VALUES ('1123',NULL,17,'Not really 
> sure what to put in here But I am sure i will told :)','17.30',1,NULL,NULL,'2001-01-
> 17',1,'Beans\015\012Means\015\012Hines','','','African Mist','0.00',7);
> Any idea as to why this is doing this?
> Thank you for your help.
> Dan
> 


In response to

pgsql-novice by date

Next:From: Ron St-PierreDate: 2004-09-08 15:11:56
Subject: Re: I NEED HELP!!! - (ERROR: parser: unterminated quoted
Previous:From: Tom LaneDate: 2004-09-08 14:08:19
Subject: Re: Problem executing user function (on Solaris)

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