Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 9DBF9133616B for ; Thu, 10 Feb 2011 15:40:53 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 91518-06 for ; Thu, 10 Feb 2011 19:40:46 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from depesz.com (martin.depesz.com [188.40.39.14]) by mail.postgresql.org (Postfix) with ESMTP id F26281337B8D for ; Thu, 10 Feb 2011 15:40:45 -0400 (AST) Received: from martin.depesz.com ([188.40.39.14] helo=depesz.com) by depesz.com with esmtpa (Exim 4.69) (envelope-from ) id 1PncNg-0005Lg-FM; Thu, 10 Feb 2011 20:40:44 +0100 Date: Thu, 10 Feb 2011 20:40:44 +0100 From: hubert depesz lubaczewski To: Savita Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #5877: problem with wild char used in where clause Message-ID: <20110210194044.GA17765@depesz.com> Reply-To: depesz@depesz.com References: <201102101102.p1AB2eCZ025163@wwwmaster.postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201102101102.p1AB2eCZ025163@wwwmaster.postgresql.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201102/99 X-Sequence-Number: 29371 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