Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

when adding content (node/add/article in UI) i get this error:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '147' for key 'PRIMARY': INSERT INTO {node} (nid, vid, type, language, title, uid, status, created, changed, comment, promote, sticky, tnid, translate) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12, :db_insert_placeholder_13); Array ( [:db_insert_placeholder_0] => 147 [:db_insert_placeholder_1] => 147 [:db_insert_placeholder_2] => article [:db_insert_placeholder_3] => fa [:db_insert_placeholder_4] => rewq [:db_insert_placeholder_5] => 1 [:db_insert_placeholder_6] => 0 [:db_insert_placeholder_7] => 1354548748 [:db_insert_placeholder_8] => 1354548748 [:db_insert_placeholder_9] => 2 [:db_insert_placeholder_10] => 0 [:db_insert_placeholder_11] => 0 [:db_insert_placeholder_12] => 0 [:db_insert_placeholder_13] => 0 ) in drupal_write_record() (line 7114 of /var/www/vhosts/******/httpdocs/includes/common.inc).

I've read if I upgrade my php to 5.4 (from current 5.3) it will be solved Is there not any easier option? ( well it wont be easy for my upgrading php on this particular server right now)

I also changed node table structure, set vid default value from NULL to 0 ( it was mention somewhere on drupal.org) but no change

tanx in advance

share|improve this question
That'a MySQL error, nothing to do with PHP...you'll receive exactly the same error no matter what version of PHP you're using. Upgrading won't fix anything. How are you adding this content, through the UI? – Clive Dec 4 '12 at 8:57
Also, it'd be good to check for any pending database updates (70xx) in Drupal and run them. – Artur Dec 5 '12 at 7:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.