From: Tom Lane <tgl@sss.pgh.pa.us>
To: Marc Fromm <Marc.Fromm@wwu.edu>
Cc: Craig James <cjames@emolecules.com>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: select exact term
Date: Thu, 28 Mar 2013 16:06:59 -0400
Message-ID: <22453.1364501219@sss.pgh.pa.us> (raw)
In-Reply-To: <93361C67E4EE844A80935863A4FF4B6C0632FC7D@Exch2010MB-2.univ.dir.wwu.edu>
References: <93361C67E4EE844A80935863A4FF4B6C0632F7FF@Exch2010MB-2.univ.dir.wwu.edu>
<CAFwQ8rfig1YY_r0PpDssHafh8_6gfynWq9i7akF_2KaFaL_MeA@mail.gmail.com>
<93361C67E4EE844A80935863A4FF4B6C0632FC7D@Exch2010MB-2.univ.dir.wwu.edu>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>
Marc Fromm <Marc.Fromm@wwu.edu> writes:
> I am struggling with the syntax. In php I create my where clause as shown, using ~* for case insensitive:
> $search = "art";
> $strSQL2 = "WHERE (title ~* [[:<:]]'$search'[[:>:]] OR description ~* [[:<:]]'$search'[[:>:]]) ";
> When executed zero records are returned even though the ILIKE statement shown below returns records that do have the word art.
Your php app must not be bothering to check for errors :-( ... that's
invalid SQL syntax. The bracket constructs are part of the regexp
string and need to be inside the single quotes.
regards, tom lane
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
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-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, Marc.Fromm@wwu.edu, cjames@emolecules.com
Subject: Re: select exact term
In-Reply-To: <22453.1364501219@sss.pgh.pa.us>
* 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