Re: BUG #3394: Partial search not working

Поиск
Список
Период
Сортировка
От Murali Doss
Тема Re: BUG #3394: Partial search not working
Дата
Msg-id 7C83A8A6B56D3A478333B1DF47E18586B93140@mpbabgex01.corp.mphasis.com
обсуждение исходный текст
Ответ на Re: BUG #3394: Partial search not working  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-bugs
Hi,

Output of pg_setting in Linux OS

"lc_collate";"C"
"lc_ctype";"C"
"lc_messages";"C"
"lc_monetary";"C"
"lc_numeric";"C"
"lc_time";"C"

Client Encoding

"SQL_ASCII"

Server Encoding

"SQL_ASCII"

And it's same in Solaris and Window OS where the query is returning expecte=
d results.

Regards
Murali


-----Original Message-----
From: Alvaro Herrera [mailto:alvherre@commandprompt.com]=20
Sent: Tuesday, June 19, 2007 7:30 PM
To: Murali Doss
Cc: Douglas Toltzman; pgsql-bugs@postgresql.org
Subject: Re: [BUGS] BUG #3394: Partial search not working

Murali Doss wrote:
> I have created new database with encoding as sql_ascii and reloaded the
> data but still its returning 0 rows in Linux.
>=20
> SELECT * FROM tablename WHERE colname BETWEEN 'B' AND 'B~';

You probably didn't set the appropriate collation, which is the thing
that affects this type of query.  Beware that collation and encoding are
closely related so it still won't work if you choose mismatching
settings.  You probably want C locale as well as SQL_ASCII encoding.

The query is probably poorly thought out though.  Why are you not using
WHERE colname LIKE 'B%'?  How do you know what does your collation
consider as being between B and B~?  Remember, text values are not
necessarily compared using byte comparison.  The C locale uses byte
comparison but I think it's the only one that does so.

--=20
Alvaro Herrera                  http://www.amazon.com/gp/registry/5ZYLFMCVH=
XC
"Saca el libro que tu religi=F3n considere como el indicado para encontrar =
la
oraci=F3n que traiga paz a tu alma. Luego rebootea el computador
y ve si funciona" (Carlos Ducl=F3s)

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #3394: Partial search not working
Следующее
От: nasim.sindri@gmail.com
Дата:
Сообщение: commit transaction failed