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

Re: Cannot insert a duplicate key into unique index

From: "V i s h a l Kashyap (at) [Sai Hertz And Control Systems]" <sank89(at)sancharnet(dot)in>
To: adelaide(at)zedemail(dot)ca
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Cannot insert a duplicate key into unique index
Date: 2004-02-29 06:07:11
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
Dear Adelaide  ,

>Warning: PostgreSQL query failed: ERROR: Cannot insert a duplicate key
>into unique index fee_uk
Check the max value in data base for the same index key and then check if
the max value agree with the sequence .
do some thing like
select max(fees.fee_id);
select nextval('general_seq'::text);
on psql command prompt
Now if the max value of  fees.fee_id
is greater than what  nextval returns
then this sequence has to be fixed

Have you recently done an dump restore ?

Best Regards,
Vishal Kashyap
Director / Lead Developer,
Sai Hertz And Control Systems Pvt Ltd,
Jabber IM: vishalkashyap(at)jabber(dot)org
ICQ :      264360076
You yourself, as much as anybody in the entire 
universe, deserve your love and affection.
- Buddha
I am usually called by the name Vishal Kashyap
and my Girlfriend calls me Vishal CASH UP.
This is because everyone loves me as Vishal Kashyap
and my Girlfriend loves me as CASH.
                  ( 0_0 )

In response to

pgsql-novice by date

Next:From: Markus BertheauDate: 2004-02-29 09:50:37
Subject: Re: pg_dumpall and convert from LATIN1 to UTF-8?
Previous:From: Tom LaneDate: 2004-02-29 04:00:56
Subject: Re: help with COPY query

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