Re: LIKE with no wildcards problem - Mailing list pgsql-sql

From Josh Berkus
Subject Re: LIKE with no wildcards problem
Date
Msg-id web-813010@davinci.ethosmedia.com
Whole thread Raw
In response to LIKE with no wildcards problem  ("John J. Allison" <john@joss.ucar.edu>)
List pgsql-sql
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 actuallybeing stored is "abc     " not "abc".  I think you
wantto use VARCHARinstead.
 

-Josh


pgsql-sql by date:

Previous
From: "John J. Allison"
Date:
Subject: LIKE with no wildcards problem
Next
From: Ian Barwick
Date:
Subject: Re: LIKE with no wildcards problem