dbTalk Databases Forums  

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

comp.databases.postgresql.novice comp.databases.postgresql.novice


Discuss Why am I getting the error: "Cannot insert a duplicate key into unique index"? in the comp.databases.postgresql.novice forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Daniel Secomb
 
Posts: n/a

Default Why am I getting the error: "Cannot insert a duplicate key into unique index"? - 09-08-2004 , 08:48 AM






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","cat egory","image","file","dat
e","uid","sub_type1","sub_type2","sub_type3","titl e","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


Reply With Quote
  #2  
Old   
paul@entropia.co.uk
 
Posts: n/a

Default Re: Why am I getting the error: "Cannot insert a duplicate key into unique index"? - 09-08-2004 , 09:16 AM






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.

Quote:
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","cat egory","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','','','Afr ican Mist','0.00',7);
Any idea as to why this is doing this?
Thank you for your help.
Dan





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.