Re: BUG #5877: problem with wild char used in where clause

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: Savita <savita(dot)halli(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5877: problem with wild char used in where clause
Date: 2011-02-10 19:40:44
Message-ID: 20110210194044.GA17765@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)depesz(dot)com / aim:depeszhdl / skype:depesz_hdl / gg:6749007

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Kevin Grittner 2011-02-10 19:45:37 Re: BUG #5877: problem with wild char used in where clause
Previous Message Kevin Grittner 2011-02-10 19:37:29 Re: BUG #5877: problem with wild char used in where clause