Search Postgresql Archives

Re: text column indexing in UTF-8 database

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

 



Jeff Davis <pgsql@xxxxxxxxxxx> writes:
> It looks like an index using text_pattern_ops can be used for equality
> (see my test case below).

This is true as of 8.4; prior versions make a distinction between =
and ~=~.

> This works apparently because texteq() is defined as bitwise-equality.
> Is that really correct? I was under the impression that some locales do
> not obey that rule, and may consider two slightly different strings to
> be equal.

The locale might, but Postgres doesn't --- look at the implementation
of texteq().

There is actually some history here; the former distinction in the
equality operators arose from exactly your concern.  But after we
put in the second-pass check to insist on bitwise equality, we
realized that the equality operators really were equivalent.

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[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