From: Josh Berkus <josh@agliodbs.com>
To: John J. Allison <john@joss.ucar.edu>
To: pgsql-sql@postgresql.org
Subject: Re: LIKE with no wildcards problem
Date: Thu, 28 Feb 2002 11:28:37 -0800
Message-ID: <web-813010@davinci.ethosmedia.com> (raw)
In-Reply-To: <200202281854.LAA13770@virga.joss.ucar.edu>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: josh@agliodbs.com, john@joss.ucar.edu
Subject: Re: LIKE with no wildcards problem
In-Reply-To: <web-813010@davinci.ethosmedia.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox