Re: regarding contains operator

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: "surabhi(dot)ahuja" <surabhi(dot)ahuja(at)iiitb(dot)ac(dot)in>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: regarding contains operator
Date: 2006-03-08 10:46:13
Message-ID: 20060308104613.GA44588@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Mar 08, 2006 at 03:13:40PM +0530, surabhi.ahuja wrote:
> please tell me is there any operator available which enables me to do the following:
>
> field contains <some value>
>
> eg field contains "abc" should return true, similary for def or tez

See "Pattern Matching" in the "Functions and Operators" chapter of
the documentation.

http://www.postgresql.org/docs/8.1/interactive/functions-matching.html

You mentioned that your data contains backslashes. Backslashes
have special meaning to the string parser and in search patterns,
so if you need to match a literal backslash then you might need to
write more backslashes than you'd expect. If you're using 8.0 or
later then dollar quotes can make writing patterns easier because
they don't treat backslashes as special.

http://www.postgresql.org/docs/8.1/interactive/sql-syntax.html#SQL-SYNTAX-DOLLAR-QUOTING

--
Michael Fuhr

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tomi NA 2006-03-08 13:11:13 database/schema level triggers?
Previous Message Jussi Saarinen 2006-03-08 10:15:05 8.0 Client can't connect to 7.3 server?