Reputation: 255
I have the above error.
First of all I'm trying to fully understand what it means.
Secondly I've tried investigating my tables in my database and the following query returns zero results as I understand that the error is a primary key related issue.
SELECT DISTINCT TABLE_NAME ,column_name
FROM INFORMATION_SCHEMA.key_column_usage
WHERE TABLE_SCHEMA IN ('dosiv_querta');
Here is the statement that throws the error.
INSERT INTO `ps_product_shop` (`id_product`, `id_category_default`, `id_tax_rules_group`, `on_sale`, `online_only`, `ecotax`, `minimal_quantity`, `price`, `wholesale_price`, `unity`, `unit_price_ratio`, `additional_shipping_cost`, `customizable`, `text_fields`, `uploadable_files`, `active`, `redirect_type`, `id_product_redirected`, `available_for_order`, `available_date`, `condition`, `show_price`, `indexed`, `visibility`, `cache_default_attribute`, `advanced_stock_management`, `date_add`, `date_upd`, `pack_stock_type`, `id_shop`) VALUES ('1', '32', '1', '0', '0', '0', '1', '38.99', '0', '', '0', '0', '0', '0', '0', '1', '', '0', '1', '0000-00-00', 'new', '1', '0', 'both', '0', '0', '2015-08-21 00:31:40', '0000-00-00', '3', '1')
Upvotes: 0
Views: 5217
Reputation: 73
It sounds like you're trying to insert a new record with a value of 1 in the primary key column. Since the primary key needs to be unique, it won't let you insert the record. Here's a simple example that reproduces the issue:
mysql> CREATE TABLE TestPrimary (
ColOne INT NOT NULL,
ColTwo VARCHAR(255) NULL,
PRIMARY KEY(ColOne)
) ENGINE=InnoDB;
Query OK, 0 rows affected (0.02 sec)
mysql>
mysql> INSERT INTO TestPrimary (ColOne,ColTwo) VALUES (1,"blah");
Query OK, 1 row affected (0.01 sec)
mysql>
mysql> INSERT INTO TestPrimary (ColOne,ColTwo) VALUES (1,"boo");
ERROR 1062 (23000): Duplicate entry '1' for key 'PRIMARY'
Upvotes: 1