Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1ULJ6L-0005rJ-64 for pgsql-admin@arkaria.postgresql.org; Thu, 28 Mar 2013 20:07:09 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1ULJ6K-0006jU-49 for pgsql-admin@arkaria.postgresql.org; Thu, 28 Mar 2013 20:07:08 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1ULJ6J-0006jP-Dr for pgsql-admin@postgresql.org; Thu, 28 Mar 2013 20:07:07 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1ULJ6D-0007rd-6m for pgsql-admin@postgresql.org; Thu, 28 Mar 2013 20:07:06 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id r2SK6xKW022454; Thu, 28 Mar 2013 16:06:59 -0400 (EDT) From: Tom Lane To: Marc Fromm cc: Craig James , "pgsql-admin@postgresql.org" Subject: Re: select exact term In-reply-to: <93361C67E4EE844A80935863A4FF4B6C0632FC7D@Exch2010MB-2.univ.dir.wwu.edu> References: <93361C67E4EE844A80935863A4FF4B6C0632F7FF@Exch2010MB-2.univ.dir.wwu.edu> <93361C67E4EE844A80935863A4FF4B6C0632FC7D@Exch2010MB-2.univ.dir.wwu.edu> Comments: In-reply-to Marc Fromm message dated "Thu, 28 Mar 2013 19:02:16 -0000" Date: Thu, 28 Mar 2013 16:06:59 -0400 Message-ID: <22453.1364501219@sss.pgh.pa.us> X-Pg-Spam-Score: -3.2 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org Marc Fromm 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