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