How duplicate data produce when a UNIQUE index exite ?

From: RD黄永卫 <yongwei_huang(at)gtmc(dot)com(dot)cn>
To: <pgsql-bugs(at)postgresql(dot)org>, <pgsql-general(at)postgresql(dot)org>
Subject: How duplicate data produce when a UNIQUE index exite ?
Date: 2009-11-25 05:56:39
Message-ID: EDA3764BC9DBA043AABB8FF57D73237801595783@QFWA0016.gtmcl.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general

Dear all,

I have a table as below:

Table "public.t_sfh_history"

Column | Type | Modifiers

-------------+-----------------------------+-----------

idno | character(10) | not null

lo_date | character(8) | not null

line | character(1) | not null

tp | character(2) | not null

bcno | character(3) | not null

times | character(1) | not null

pdate | timestamp without time zone | not null

cdate | timestamp without time zone | not null

psh | character(1) | not null

hdlytime | numeric(6,0) | not null

hspr_tp | numeric(6,0) | not null

hspr_byo | numeric(6,0) | not null

hspr_deli | numeric(6,0) | not null

ltresult | numeric(6,0) | not null

ltresult_bs | numeric(6,0) | not null

dummy | character(6) | not null

Indexes:

"i_sfh_history0" UNIQUE, btree (idno, lo_date, line, tp, times)

When “reindex” operation do,this error occurred:

Nov 22 10:22:27 SUC11 postgres[14145]: [2-1] ERROR: could not create unique index

Nov 22 10:22:27 SUC11 postgres[14145]: [2-2] DETAIL: Table contains duplicated values.

Nov 22 10:22:27 SUC11 postgres[14145]: [2-3] STATEMENT: REINDEX TABLE "t_sfh_history"

My question is:

How the Duplicate datas produce when a UNIQUE index exite ?

Is this a bug of PostgreSQL ?

My postgreSQL version is :

version

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

PostgreSQL 8.1.4 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2.3 20030502 (Red Hat Linux 3.2.3-56)

(1 row)

Thank you very much

Best regards,

Ray Huang

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Scott Marlowe 2009-11-25 06:43:48 Re: [GENERAL] How duplicate data produce when a UNIQUE index exite ?
Previous Message Tom Lane 2009-11-24 22:52:45 Re: BUG #5212: incorrect resource manager data checksum in record at ...

Browse pgsql-general by date

  From Date Subject
Next Message Bino Oetomo 2009-11-25 05:58:35 Re: pgsql 'prefix' error
Previous Message Jean-Yves F. Barbier 2009-11-25 05:39:24 Re: howto escape my string