Re: BUG #5877: problem with wild char used in where clause - Mailing list pgsql-bugs

From hubert depesz lubaczewski
Subject Re: BUG #5877: problem with wild char used in where clause
Date
Msg-id 20110210194044.GA17765@depesz.com
Whole thread Raw
In response to BUG #5877: problem with wild char used in where clause  ("Savita" <savita.halli@gmail.com>)
List pgsql-bugs
On Thu, Feb 10, 2011 at 11:02:40AM +0000, Savita wrote:
> When I ran query to get the ids which ends with B1
> select id from table where id like '%B1'
> does not return me any rows. Should it be not returning row with id AB1? Is
> there known issue?

is this by any chance char(x) datatype?

if yes - please read:
http://www.depesz.com/index.php/2010/03/02/charx-vs-varcharx-vs-varchar-vs-text/

Best regards,

depesz

--
Linkedin: http://www.linkedin.com/in/depesz  /  blog: http://www.depesz.com/
jid/gtalk: depesz@depesz.com / aim:depeszhdl / skype:depesz_hdl / gg:6749007

pgsql-bugs by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: BUG #5877: problem with wild char used in where clause
Next
From: "Kevin Grittner"
Date:
Subject: Re: BUG #5877: problem with wild char used in where clause