Обсуждение: equal and like

Поиск
Список
Период
Сортировка

equal and like

От
Schwéger Gábor
Дата:
Hi List,

This is my first post to this list.
Our database moved to a larger partition.
And now I have a problem with a select query:
db=# SELECT id, login FROM u WHERE login LIKE 'bellamarth';
   id   |    login
--------+-------------
 173002 | bellamarth
(1 row)

db=# SELECT id, login FROM u WHERE login = 'bellamarth';
 id | login
----+-------
(0 rows)

The type of login is text.
What is the problem with the equal sign?
psql server version: 8.2.11

Could you help me?

Gabor



Re: equal and like

От
Bill Moran
Дата:
In response to "Schwéger Gábor" <gabor@schweger.hu>:
>
> This is my first post to this list.
> Our database moved to a larger partition.
> And now I have a problem with a select query:
> db=# SELECT id, login FROM u WHERE login LIKE 'bellamarth';
>    id   |    login
> --------+-------------
>  173002 | bellamarth
> (1 row)
>
> db=# SELECT id, login FROM u WHERE login = 'bellamarth';
>  id | login
> ----+-------
> (0 rows)
>
> The type of login is text.
> What is the problem with the equal sign?
> psql server version: 8.2.11
>
> Could you help me?

Just a guess, but does the problem go away if you do
REINDEX table u;

--
Bill Moran
Collaborative Fusion Inc.
http://people.collaborativefusion.com/~wmoran/

wmoran@collaborativefusion.com
Phone: 412-422-3463x4023

Re: equal and like

От
Quan Zongliang
Дата:
Hi, Gabor

> The type of login is text.
> What is the problem with the equal sign?
> psql server version: 8.2.11

I had tested them, both got correct result.
version: 8.2.11 & 8.3.5 for windows
without partition

Maybe, as Moran said, reindex it and try again.

-----------------------------------------------
Quan Zongliang
quanzongliang@gmail.com
CIT Japan:  http://www.cit.co.jp
CIT China:  http://www.citbj.com.cn


Re: equal and like

От
Schwéger Gábor
Дата:
Thank You.
After reindex it's working fine.

Gabor

On Ked, December 9, 2008 23:06, Bill Moran wrote:
> In response to "Schwéger Gábor" <gabor@schweger.hu>:
>>
>> This is my first post to this list.
>> Our database moved to a larger partition.
>> And now I have a problem with a select query:
>> db=# SELECT id, login FROM u WHERE login LIKE 'bellamarth';
>>    id   |    login
>> --------+-------------
>>  173002 | bellamarth
>> (1 row)
>>
>> db=# SELECT id, login FROM u WHERE login = 'bellamarth';
>>  id | login
>> ----+-------
>> (0 rows)
>>
>> The type of login is text.
>> What is the problem with the equal sign?
>> psql server version: 8.2.11
>>
>> Could you help me?
>
> Just a guess, but does the problem go away if you do
> REINDEX table u;
>
> --
> Bill Moran
> Collaborative Fusion Inc.
> http://people.collaborativefusion.com/~wmoran/
>
> wmoran@collaborativefusion.com
> Phone: 412-422-3463x4023
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>