Search Postgresql Archives

Re: is this a bug or I am blind?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tom Lane <tgl@xxxxxxxxxxxxx> 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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux