Re: duplicate rows mystery

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: duplicate rows mystery
Дата
Msg-id 20050414142433.GA21285@winnie.fuhr.org
обсуждение исходный текст
Ответ на duplicate rows mystery  (Gerry Jensen <gerry@xmission.com>)
Ответы Re: duplicate rows mystery  (Gerry Jensen <gerry@xmission.com>)
Список pgsql-novice
On Thu, Apr 14, 2005 at 03:26:16AM -0600, Gerry Jensen wrote:
>
> 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.

If the SELECT and CREATE statements are what you really did, then
you tried to create an index on the original table (pricebackup),
not the table you SELECTed into (price).  Are you sure you have the
right table names in the right places?

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

В списке pgsql-novice по дате отправления:

Предыдущее
От: malini bu
Дата:
Сообщение: Unsubscribe
Следующее
От: Tom Lane
Дата:
Сообщение: Re: duplicate rows mystery