duplicate rows mystery - Mailing list pgsql-novice

From Gerry Jensen
Subject duplicate rows mystery
Date
Msg-id Pine.LNX.4.62.0504140314240.5542@xmission.xmission.com
Whole thread Raw
Responses Re: duplicate rows mystery
Re: duplicate rows mystery
List pgsql-novice
I'm trying to remove duplicate records from a table.  The best way I could
think of was to select into a new table using DISTINCT.

I issued the following command:

select distinct on (symbol, date) * into price from pricebackup;

It did indeed remove several rows that had duplicate items.  I then tried
to build a unique index on the columns (symbol, date) in pricebackup with:

create unique index price_symbol_date on pricebackup (symbol, date);

and got the error:

ERROR:  could not create unique index
DETAIL:  Table contains duplicated values.

How is it possible that I could have duplicate values in that table when I
just selected them into the table as distinct?  What am I missing?

Any help is appreciated.

Thanks,

Gerry

pgsql-novice by date:

Previous
From: Jason Monserrate
Date:
Subject: Unsubscribe
Next
From: malini bu
Date:
Subject: ...