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

duplicate key violates unique constraint??

From: "Alexander Kuprijanov" <sanya-spb(at)mail(dot)ru>
To: <pgsql-ru-general(at)postgresql(dot)org>
Subject: duplicate key violates unique constraint??
Date: 2005-06-20 09:55:38
Message-ID: 003901c5757e$365eaab0$6b00a8c0@sanya (view raw or flat)
Thread:
Lists: pgsql-ru-general
Добрый день, уважаемые

не могу понять в чем глюк:
есть такая конструкция:
CREATE TABLE awp_elsi.i_file_v2
(
  id serial NOT NULL,
  idterm int4 NOT NULL,
  <...>
  sreserv varchar(3),
  datetimerec timestamp NOT NULL DEFAULT ('now'::text)::timestamp(6) without time zone,
  CONSTRAINT i_file_v2_pkey PRIMARY KEY (id)
) 
WITHOUT OIDS;

к ней соответственно прикручено: 
CREATE SEQUENCE awp_elsi.i_file_v2_id_seq
  INCREMENT 1
  MINVALUE 1
  MAXVALUE 9223372036854775807
  START 926 
  CACHE 1;

пытаюсь сделать (ключ, как видите, не трогаю..):
INSERT INTO awp_elsi.i_file_v2
(idterm,ups_code,unb_code,szdocumentnum,cstarttankvbx,ulps_volume,ulps_density,ulps_weight,utanknumber,startrec,ups_cels,ips_cels_income,uaktnumber,finishrec,dsr_volume,dsr_weight,dsr_density,cstarttank,fdeltavolume,fdeltamass,imid_cels,sreserv)
VALUES
(679,7,777,'777',null,30,7674,23,2,'2005-06-17 11:5:36',0,0,0,'2005-06-17 11:5:36',30,23.01,7674,'0',0.0,0,0.0,'');

и в ответ получаю:
ERROR:  duplicate key violates unique constraint "i_file_v2_pkey"

кто-нить может чего сказать?

PS: postgresql-7.4.3

In response to

Responses

pgsql-ru-general by date

Next:From: Alexander KuprijanovDate: 2005-06-20 11:58:41
Subject: Re: duplicate key violates unique constraint??
Previous:From: Oleg BartunovDate: 2005-06-14 11:38:32
Subject: Re: Ошибка при вставке.

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