Received: from falla.videotron.net (falla.videotron.net [205.151.222.106]) by hub.org (8.9.3/8.9.3) with ESMTP id MAA87005 for ; Mon, 22 May 2000 12:55:58 -0400 (EDT) (envelope-from pcoulombe@mediacces.com) Received: from mediacces.com ([24.201.179.114]) by falla.videotron.net (Sun Internet Mail Server sims.3.5.1999.12.14.10.29.p8) with ESMTP id <0FUZ008RY05XIH@falla.videotron.net> for pgsql-sql@postgresql.org; Mon, 22 May 2000 12:51:38 -0400 (EDT) Date: Mon, 22 May 2000 00:50:19 -0400 From: Patrick Coulombe Subject: duplicate key To: pgsql-sql@postgresql.org Message-id: <3928BC8B.9C2CF63@mediacces.com> MIME-version: 1.0 X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.2.14-5.0 i686) Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Accept-Language: en X-Archive-Number: 200005/100 hi, medias=> insert into medias (name, location) values ('BLABLA', 'Montreal'); ERROR: Cannot insert a duplicate key into a unique index Here's my database & tables : Database = medias +------------------+----------------------------------+----------+ | Owner | Relation | Type | +------------------+----------------------------------+----------+ | postgres | medias | table | | postgres | medias_media_id_key | index | | postgres | medias_media_id_seq | sequence | +------------------+----------------------------------+----------+ Table = medias +----------------------------------+----------------------------------+-------+ | Field | Type | Length| +----------------------------------+----------------------------------+-------+ | media_id | int4 not null default nextval('" | 4 | | name | text not null | var | | location | text | var | +----------------------------------+----------------------------------+-------+ I don't specify a value to media_id, so why i got this error? It's supposed to increment by itself (media_id serial). But, i have to say that i import the data in medias with the function copy from... i import also media_id information. Maybe now, i cannot add because my medias_media_id_seq do not correspond to my new "importation". How can I fix that? Thank you very very much and once again sorry for my english. Patrick