Re: ILIKE Problem? - Mailing list pgsql-general

From Darren Ferguson
Subject Re: ILIKE Problem?
Date
Msg-id 3ECD5936.9010109@crystalballinc.com
Whole thread Raw
In response to ILIKE Problem?  ("Corey W. Gibbs" <cgibbs@westmarkproducts.com>)
List pgsql-general
When you do the first one since you are not using %% values like will
treat this as = so it would have to exactly equal what you put in the
where clause. (someone correct if this is wrong but i believe it is correct)

In the second one you use the % which means it appears anywhere in the
string i.e.

%test - will return test, atest, and test would have to be the last word
in the string.

test% - will return test as the first word followed by anything else

%test% - will return any string with the text "test" in it.

test - will be the same as evlvlist = 'test'

HTH
Darren

Corey W. Gibbs wrote:

>Good Afternoon Everyone,
>
>I was wondering if I am running into a problem with ILIKE.  Here is what happened:
>
>When trying to execute this select statement:
>    SELECT * from elevlist WHERE fulldwgpath ILIKE '\\\\cad_svr\\someDirectory-name-thatis-long\\somefile.dwg'
>0 rows are returned, but if I shorten it to:
>    SELECT * from elevlist WHERE fulldwgpath ='%somefile.dwg%'
>my rows are returned.  fulldwgpath is a varchar(250) datatype.
>
>Any ideas?
>thanks in advance
>corey
>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 5: Have you checked our extensive FAQ?
>
>http://www.postgresql.org/docs/faqs/FAQ.html
>
>


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Query failed: ERROR: catalog is missing 1 attribute(s) for relid 456086
Next
From: Tom Lane
Date:
Subject: Re: [ADMIN] Q: Structured index - which one runs faster?