error: duplicate key

From: Marc Fromm <Marc(dot)Fromm(at)wwu(dot)edu>
To: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: error: duplicate key
Date: 2009-06-17 16:51:49
Message-ID: B0D7C0A3F35FE144A70312D086CBCA9B038513CF80@ExchMailbox2.univ.dir.wwu.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

I am receiving this error when I try to add new records:

INSERT INTO "public"."classification_guide_cats" ("id", "cat_title") VALUES (nextval(('"classification_guide_cat_id_seq"'::text)::regclass), 'temp')
SQL error:
ERROR: duplicate key violates unique constraint "classification_guide_cats_pkey"

id is a primary key nextval(('"classification_guide_job_id_seq"'::text)::regclass)

Could the primary key count have been reset so that it is starting at 1 again? The primary key id is up to 128.

Thanks

Marc

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Scott Marlowe 2009-06-17 17:09:46 Re: error: duplicate key
Previous Message Patryk Sosinski 2009-06-17 15:54:24 Postgre Service Cant Start