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

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 (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-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

pgsql-bugs by date

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

pgsql-general by date

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

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