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_type1","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);