Re: is this a bug or I am blind? - Mailing list pgsql-general

From Gregory S. Williamson
Subject Re: is this a bug or I am blind?
Date
Msg-id 71E37EF6B7DCC1499CEA0316A2568328024BBCE1@loki.wc.globexplorer.net
Whole thread Raw
In response to is this a bug or I am blind?  (Mage <mage@mage.hu>)
List pgsql-general
Well, then I have the disease. The database is UNICODE:
gex_runtime=# select gex_clientname from gex_clients where gex_clientname = 'HomeHappinesses';
                        gex_clientname
--------------------------------------------------------------
 HomeGain
(1 row)

gex_runtime=# select gex_clientname from gex_clients where gex_clientname like 'HomeHappinesses';
 gex_clientname
----------------
(0 rows)

>
> Gregory S. Williamson wrote:
> >
> > I am puzzled by the lack of a "%" in the LIKE query. When I try this on
> > postgres 7.4 and 8.0 I get no rows when I am missing it; including it
> > works as expected.
> >
> > The names have been changed to protect the guilty ;-} but the core of it
> > is true -- no "%" means wierdnesses, I think.
> >
> > gex_runtime=# select gex_clientname from gex_clients where gex_clientname like 'Home';
> >  gex_clientname
> > ----------------
> > (0 rows)
> >
> > gex_runtime=# select gex_clientname from gex_clients where gex_clientname like 'Home%';
> >                         gex_clientname
> > --------------------------------------------------------------
> >  HomeHappinesses
> >  HomeMorgageValues, Inc.
> > (2 rows)
> >
> > Could you try your query again with the wild card ?
>
> But "like" without any wildcards should be the same as "=", but it isn't
> in the original post.
>

Well then I have the same behavior -- the database is UNICODE:

gex_runtime=# select gex_clientname from gex_clients where gex_clientname = 'HomeHappinesses';
                        gex_clientname
--------------------------------------------------------------
 HomeHappinesses
(1 row)

gex_runtime=# select gex_clientname from gex_clients where gex_clientname like 'HomeHappinesses';
 gex_clientname
----------------
(0 rows)

An "=" is not equivalent to LIKE with no wildcard.

I never really thought of this as a bug, but if it is ... ring one up for Mage as a good catch.




pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: enable SSL on server
Next
From: "Karl O. Pinc"
Date:
Subject: "gmake check" fails with 8.1.1