Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5948913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:10:33+00:00 2026-05-22T17:10:33+00:00

I have a drupal site which uses CCK content fields to store a majority

  • 0

I have a drupal site which uses CCK content fields to store a majority of its data.

I want to manually change some of the data to point to a different node version.

UPDATE content_field_table SET vid = '1234' WHERE nid = '12' AND vid = '123';

The problem is that content_field_table has a composite primary key of

PRIMARY KEY (`vid`,`delta`)

So that when I run the update statement, I get the following error:

Error Code: 1062
Duplicate entry ‘52979-0’ for key ‘PRIMARY’

How can I update the vid as needed?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T17:10:34+00:00Added an answer on May 22, 2026 at 5:10 pm

    A Primary Key must be unique. So you cannot change one record to have the same PK as an existing record

    For example if you get any records from the SQL below then the update you want to perform cannot be done. You’ll either need to make some other change first or delete a record or remove the PK

    SELECT SOURCE.delta, 
           SOURCE.vid, 
           TARGET.delta, 
           TARGET.vid 
    FROM   content_field_table SOURCE 
           INNER JOIN content_field_table TARGET 
             ON SOURCE.delta = TARGET.delta 
    WHERE  SOURCE.vid = '123' 
           AND TARGET.vid = '1234' 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Drupal site on which users can enter CCK content by uploading
I have a Drupal (v6.17) Content Type which includes a Taxonomy field. I want
I have a few Views on my Drupal 6 site which take care of
I want to make a community based site, which is Drupal's strength. However I
I have a Drupal 5 website on which I want to display a list
I have a non-Drupal site which authenticates with a simple MySQL user database. I
I have an image gallery within a Drupal site that uses the 'Image Gallery'
I have a PHP text-size select function within a Drupal site: It uses this
I have created a drupal module which displays some reporting data. I would like
I have a multisite with drupal, I created a site which at first should

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.