Duplicate key

From: Miguel Omar Carvajal <omar(at)carvajal(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: Duplicate key
Date: 2002-03-14 15:36:00
Message-ID: 02031410360001.06591@power9.carvajal.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Hi all,

I am having a problem with PostgreSQL 7.1.3 using Redhat 7.1 and it is the
following: I have a program I am making in C++ that is sending four simple
insert commands to postgres and I keep getting an "ERROR: Cannot insert a
duplicate key into unique index dbshpawb001"(this is what I see when I put
postmaster in debug level 4, see attached file.) the inserts are:

insert into dbshpawb
("courier_id","pos_shipper","pos_recipient","manifest_no","pos_sender","bill_
no","pckg_no","status","cap_user","cap_time","cap_date","upd_user","upd_time"
,"upd_date","pckgs","container_no","package_no","real_weight","weight_units")
values('2','3','5','25','3','234','1','A','29','08:55:01PM','03/12/02','29',
'08:55:01PM','03/12/02','1','1','1','10','P');insert into dbshpawb
("courier_id","pos_shipper","pos_recipient","manifest_no","pos_sender","bill_
no","pckg_no","status","cap_user","cap_time","cap_date","upd_user","upd_time"
,"upd_date","pckgs","container_no","package_no","real_weight","weight_units")
values('2','3','5','25','3','235','1','A','29','08:55:01PM','03/12/02','29',
'08:55:01PM','03/12/02','1','1','2','4','P'); insert into dbshpawb
("courier_id","pos_shipper","pos_recipient","manifest_no","pos_sender","bill_
no","pckg_no","status","cap_user","cap_time","cap_date","upd_user","upd_time"
,"upd_date","pckgs","container_no","package_no","real_weight","weight_units")
values('2','3','5','25','3','236','1','A','29','08:55:02PM','03/12/02','29',
'08:55:02PM','03/12/02','1','1','3','20','P');insert into dbshpawb
("courier_id","pos_shipper","pos_recipient","manifest_no","pos_sender","bill_
no","pckg_no","status","cap_user","cap_time","cap_date","upd_user","upd_time"
,"upd_date","pckgs","container_no","package_no","real_weight","weight_units")
values('2','3','5','25','3','237','1','A','29','08:55:02PM','03/12/02','29',
'08:55:02PM','03/12/02','1','1','4','90','P');

the table structure is:

CREATE TABLE "dbshpawb" (
"courier_id" int4,
"pos_shipper" int2,
"pos_recipient" int2,
"manifest_no" int4,
"pos_sender" int2,
"bill_no" int4,
"status" char(1),
"cap_user" int8,
"cap_date" date,
"cap_time" time,
"upd_user" int8,
"upd_date" date,
"upd_time" time,
"pckgs" int2,
"container_no" int2 default 0,
"package_no" int2 default 0,
"real_weight" real default 0,
"weight_units" char(1),
"pckg_no" int2 default 0
);
CREATE UNIQUE INDEX "dbshpawb001" on "dbshpawb" using btree (
"courier_id" "int4_ops",
"pos_shipper" "int2_ops",
"pos_recipient" "int2_ops",
"manifest_no" "int4_ops",
"container_no" "int2_ops",
"pos_sender" "int2_ops",
"bill_no" "int4_ops"
);

can someone please shed some light on what I am doing wrong?

Thanks in advance,
Omar Carvajal

-------------------------------------------------------

Attachment Content-Type Size
output.txt text/plain 58.4 KB

Browse pgsql-interfaces by date

  From Date Subject
Next Message Joep deVocht 2002-03-14 18:04:40 Reset?
Previous Message Marc Blanc 2002-03-14 07:37:00 Re: TCP/IP database connection problem with pgaccess