DISTINCT is not quite distinct

Поиск
Список
Период
Сортировка
От Florian Weimer
Тема DISTINCT is not quite distinct
Дата
Msg-id 82lkmoy979.fsf@mid.bfk.de
обсуждение исходный текст
Ответы Re: DISTINCT is not quite distinct  (Richard Huxton <dev@archonet.com>)
Re: DISTINCT is not quite distinct  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
I run this innocent query

CREATE TABLE foo AS SELECT DISTINCT bar FROM baz ORDER BY bar;

and the resulting table contains duplicate rows. 8-(

According to EXPLAIN, an index scan on the bar column is used (using
the underlying B-tree index).  This is with PostgreSQL 8.1.4 (Debian
package 8.1.4-6).  Is this a known problem?

If I drop the DISTINCT, the output is not correctly ordered, either.
Perhaps this is an index corruption issue?  The hardware itself seems
fine.

--
Florian Weimer                <fweimer@bfk.de>
BFK edv-consulting GmbH       http://www.bfk.de/
Kriegsstraße 100              tel: +49-721-96201-1
D-76133 Karlsruhe             fax: +49-721-96201-99

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

Предыдущее
От: Bill Moran
Дата:
Сообщение: Re: first steps in PhP and PostgreSQL
Следующее
От: Roman Neuhauser
Дата:
Сообщение: Re: first steps in PhP and PostgreSQL