Re: is this a bug or I am blind?

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: is this a bug or I am blind?
Дата
Msg-id 87lkymc9fg.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Re: is this a bug or I am blind?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: is this a bug or I am blind?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Tom Lane <tgl@sss.pgh.pa.us> writes:

> Non-self-consistent comparison results can lead to an index that is
> either actually or effectively corrupt (because index searches proceed
> down the wrong tree path and thus fail to find items that should be
> found).  So the observation that only index searches fail is consistent
> with this idea.

I wondered if there were some simple tests Postgres could do to notice the
problem and report it. Checking to make sure strcoll(a,b) = -strcoll(b,a) for
example.

But then I thought of another idea. What if Postgres just used strxfrm()
instead of strcoll everywhere? Then it ought to never produce inconsistent
results. At least if strxfrm() doesn't just return randomly varying results
for the same inputs. I suspect the worst case in practice is that strxfrm()
will return the same data for just about every input string, which would
hopefully be noticed by the user. But at least wouldn't cause corrupted
indexes.

--
greg

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

Предыдущее
От: Michelle Konzack
Дата:
Сообщение: Re: 7.4.5 vs 8.0 on Debian/sparc
Следующее
От: Tom Lane
Дата:
Сообщение: Re: is this a bug or I am blind?