Re: [GENERAL] Search

From: Oleg Broytmann <phd(at)emerald(dot)netskate(dot)ru>
To: Dmitry Popov <mitlas(at)auricvision(dot)com>
Cc: pgsql-general(at)hub(dot)org
Subject: Re: [GENERAL] Search
Date: 1999-08-02 09:04:20
Message-ID: Pine.LNX.4.04.9908021257180.10195-100000@emerald.netskate.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, 31 Jul 1999, Dmitry Popov wrote:
> I store text data in windows-1251 encoding in my pgSQL database
> and when I execute SQL command like
>
> SELECT title, firstname, lastname, description FROM stuff
> WHERE title LIKE '%<keyword>%' AND firtsname LIKE '%<keyword>%'
> AND lastname LIKE '%<keyword>%' AND description LIKE '%<keyword>%'
>
> the response comes really quick, but if I want case independent
> search, I should convert, using my own PHP3 function, both search
> field and keyword to low case just becouse PostgreSQL by itself
> doesn't know how to convert characters in windows-1251 encoding
> to low case. And response time grows from 0:07 to 1:10!
>
> Is there any solution? May be stored procedures (that doesn't
> require to recompile pgSQL)? Thank you in advance!!!

> P.S.: as far as I know there is no locale for windows-1251 and,
> unfortunately, I can't store data in koi8-r whose locale present
> in almost all UNIX'es.

Incorrect solution: install win1251 locale. Once I saw a reference to
such beast in Russian Apache mailing list. Search through mail archive,
look into Apache-Rus FAQs...

Correct solution: use koi8-r locale and koi8<=>win1251 on-the-fly
conversion. Postgres starting from 6.5 can do on the fly conversion between
many Cyrillic locales. Look into doc/README.locale.

> --
> BEST WISHES, Dmitry
> Webmaster, DeltaCube Studio
> http://www.deltacube.com/

Oleg.
----
Oleg Broytmann http://members.xoom.com/phd2/ phd2(at)earthling(dot)net
Programmers don't die, they just GOSUB without RETURN.

In response to

  • Search at 1999-07-31 08:15:18 from Dmitry Popov

Browse pgsql-general by date

  From Date Subject
Next Message Herouth Maoz 1999-08-02 10:51:20 Re: [ANNOUNCE] Re: Contributing PDF of the PUG
Previous Message Moray McConnachie 1999-08-02 08:11:07 Re: [GENERAL] Migrating from DAO 2.5 to PostgreSQL