Cannot insert a duplicate key into unique index

Поиск
Список
Период
Сортировка
Искать
От
Adelaide Yip
Тема
Cannot insert a duplicate key into unique index
Дата
Msg-id
1077728439.4390.10.camel@blownt.millwoods.compeng.net
Список
Дерево обсуждения
Cannot insert a duplicate key into unique index Adelaide Yip <adelaide@zedemail.ca>
Re: Cannot insert a duplicate key into unique index "V i s h a l Kashyap @ [Sai Hertz And Control Systems]" <sank89@sancharnet.in>
Hi,


I get the following error when I try to insert into the table fees, even
when the primary and unique key are serial:

Warning: PostgreSQL query failed: ERROR: Cannot insert a duplicate key
into unique index fee_uk


INSERT INTO fees (registrar_name) VALUES ('blah');


Table 'fees'

     Attribute      |     Type      |                   Modifier
     
--------------------+---------------+-----------------------------------------------
 fee_id             | numeric(12,0) | not null default
nextval('general_seq'::text)
 registrar_name     | varchar(30)   | not null

Indices: fee_pk,
         fee_uk


I don't understand why I get this error when the fee_id column is serial
by default.  How can I fix this error?  And, how can I display what
value "nextval('general_seq'::text)" returns?

Thanks in advance,
Adelaide




В списке pgsql-novice по дате отправления
От: CoL
Дата:
От: Jan Wieck
Дата:
FAQ