Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (Postfix) with ESMTP id 5BE93475E4A for ; Thu, 28 Feb 2002 14:28:39 -0500 (EST) Received: from [209.10.40.250] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.5.2) with HTTP id 813010; Thu, 28 Feb 2002 11:28:37 -0800 From: "Josh Berkus" Subject: Re: LIKE with no wildcards problem To: "John J. Allison" , pgsql-sql@postgresql.org X-Mailer: CommuniGate Pro Web Mailer v.3.5.2 Date: Thu, 28 Feb 2002 11:28:37 -0800 Message-ID: In-Reply-To: <200202281854.LAA13770@virga.joss.ucar.edu> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Archive-Number: 200202/454 X-Sequence-Number: 6875 John, > When doing a select with a LIKE in the where clause, > I always get 0 rows if I do not use a wildcard [_%]. > LIKE should act like = in this case (and the docs say so). > A select without a from correctly returns 't'. > I am using PostgreSQL 7.1.3 on Solaris. > What am I missing? > catalog^> create table foo ( bar char(8) ) > CREATE > You created the column bar as CHAR(8), which means what's actually being stored is "abc " not "abc". I think you want to use VARCHAR instead. -Josh