Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id A3049B5DC65 for ; Tue, 30 Aug 2011 12:25:14 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 75153-02-2 for ; Tue, 30 Aug 2011 15:25:08 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 830F9B5DC4E for ; Tue, 30 Aug 2011 12:25:03 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p7UFOaGZ016968; Tue, 30 Aug 2011 11:24:36 -0400 (EDT) To: emilu@encs.concordia.ca cc: pgsql-sql@postgresql.org Subject: Re: where col1 not ilike ('str1%', 'str2%'... 'strN%') support? In-reply-to: <4E5CF8F8.7030404@encs.concordia.ca> References: <4E5CF8F8.7030404@encs.concordia.ca> Comments: In-reply-to Emi Lu message dated "Tue, 30 Aug 2011 10:51:36 -0400" Date: Tue, 30 Aug 2011 11:24:36 -0400 Message-ID: <16967.1314717876@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.404 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201108/121 X-Sequence-Number: 35789 Emi Lu writes: > Does psql provide something like the following query command? > select * from tablename > where col1 not ilike ('str1%', 'str2%'... 'strN%') If you remember the operator name equivalent to ILIKE (~~*) you can do select * from tablename where not (col1 ~~* any(array['str1%', 'str2%'... 'strN%'])); regards, tom lane