Received: from thunder.joss.ucar.edu (thunder.joss.ucar.edu [128.117.90.64]) by postgresql.org (Postfix) with ESMTP id 74E1847599A for ; Thu, 28 Feb 2002 13:54:03 -0500 (EST) Received: from virga.joss.ucar.edu (virga [128.117.90.97]) by thunder.joss.ucar.edu (8.9.1/8.9.1) with ESMTP id LAA07288 for ; Thu, 28 Feb 2002 11:54:03 -0700 (MST) From: "John J. Allison" Received: (from john@localhost) by virga.joss.ucar.edu (8.9.1/8.9.1) id LAA13770 for pgsql-sql@postgresql.org; Thu, 28 Feb 2002 11:54:02 -0700 (MST) Date: Thu, 28 Feb 2002 11:54:02 -0700 (MST) Message-Id: <200202281854.LAA13770@virga.joss.ucar.edu> To: pgsql-sql@postgresql.org Subject: LIKE with no wildcards problem X-Archive-Number: 200202/453 X-Sequence-Number: 6874 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? Thanks, John Allison john@joss.ucar.edu catalog^> create table foo ( bar char(8) ) CREATE catalog^> insert into foo values ( 'abc' ) INSERT 38413 1 catalog^> insert into foo values ( '2.20' ) INSERT 38414 1 catalog^> select * from foo bar ---------- abc 2.20 (2 rows) catalog^> select * from foo where bar like 'abc' bar ----- (0 rows) catalog^> select * from foo where bar like 'abc%' bar ---------- abc (1 row) catalog^> select 'abc' like 'abc' ?column? ---------- t (1 row)