Re: Cannot insert a duplicate key into unique index - Mailing list pgsql-novice

From V i s h a l Kashyap @ [Sai Hertz And Control Systems]
Subject Re: Cannot insert a duplicate key into unique index
Date
Msg-id 4041818F.3060700@sancharnet.in
Whole thread Raw
In response to Cannot insert a duplicate key into unique index  (Adelaide Yip <adelaide@zedemail.ca>)
List 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
<code>
select max(fees.fee_id);
then
select nextval('general_seq'::text);
</code>
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,
http://saihertz.rediffblogs.com
Jabber IM: vishalkashyap@jabber.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 )
----------------o0o-----o0o---------------------


pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: help with COPY query
Next
From: Markus Bertheau
Date:
Subject: Re: pg_dumpall and convert from LATIN1 to UTF-8?