Re: Cannot insert a duplicate key into unique index

Поиск
Список
Период
Сортировка
От V i s h a l Kashyap @ [Sai Hertz And Control Systems]
Тема Re: Cannot insert a duplicate key into unique index
Дата
Msg-id 4041818F.3060700@sancharnet.in
обсуждение исходный текст
Ответ на Cannot insert a duplicate key into unique index  (Adelaide Yip <adelaide@zedemail.ca>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: help with COPY query
Следующее
От: Markus Bertheau
Дата:
Сообщение: Re: pg_dumpall and convert from LATIN1 to UTF-8?