Skip site navigation (1) Skip section navigation (2)

Primary Key error

From: "ebp" <ebp_register(at)yahoo(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Primary Key error
Date: 2002-03-04 19:12:44
Message-ID: 001c01c1c3b0$90885a00$3601a8c0@chaos (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
It seems that any additions to our target table results in a violation.

[04/Mar/2002:14:08:43][2208.492550][-conn59-] Error: Ns_PgExec: result status: 7 message: ERROR:  Cannot insert a duplicate key into unique index kbeg_pkey

[04/Mar/2002:14:08:43][2208.492550][-conn59-] Error: dbinit: error(localhost::echonew,ERROR:  Cannot insert a duplicate key into unique index kbeg_pkey
): 'insert into kbeg values (nextval('kbeg_sequence'),'Anthony','Estevez','77th street','New York','NY','77777','7777777777','AnthonyEstevez(at)yahoo(dot)com','notes',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Test',NULL,NULL,NULL)'
[04/Mar/2002:14:08:43][2208.492550][-conn59-] Error:
Database operation "dml" failed
    while executing
"ns_db dml $db "insert into kbeg values (nextval('kbeg_sequence'),[ns_dbquotevalue $fname],[ns_dbquotevalue $lname],[ns_dbquotevalue $address],[ns_dbqu..."
    invoked from within chunk: 0 of adp: /web/server1/www/kbegmailer/josestestsfiles/NewCharIn.adp

I was wondering how i could check/increment the key value, possibly to find out if there is data after the current key value. I believe that when we imported some files, they threw off the key values for some reason, probably jumping to some other starting point than the next available value.


pgsql-novice by date

Next:From: ebpDate: 2002-03-04 19:13:23
Subject: Primary Key problem
Previous:From: Anthony EstevezDate: 2002-03-04 19:12:36
Subject: Primary Key error

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group