Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 9B522B5DC35 for ; Tue, 30 Aug 2011 12:48:45 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 30910-04 for ; Tue, 30 Aug 2011 15:48:39 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from oldperseverance.encs.concordia.ca (oldperseverance.encs.concordia.ca [132.205.96.94]) by mail.postgresql.org (Postfix) with ESMTP id 60A06B5DC26 for ; Tue, 30 Aug 2011 12:48:39 -0300 (ADT) Received: from cacao.encs.concordia.ca (emilu@cacao.encs.concordia.ca [132.205.47.225]) by oldperseverance.encs.concordia.ca (envelope-from emilu@encs.concordia.ca) (8.13.7/8.13.7) with ESMTP id p7UFmcrA000801; Tue, 30 Aug 2011 11:48:38 -0400 Message-ID: <4E5D0656.8090709@encs.concordia.ca> Date: Tue, 30 Aug 2011 11:48:38 -0400 From: Emi Lu Reply-To: emilu@encs.concordia.ca User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.16) Gecko/20101125 Lightning/1.0b1 Thunderbird/3.0.11 MIME-Version: 1.0 To: Tom Lane CC: pgsql-sql@postgresql.org Subject: Re: where col1 not ilike ('str1%', 'str2%'... 'strN%') support? References: <4E5CF8F8.7030404@encs.concordia.ca> <16967.1314717876@sss.pgh.pa.us> In-Reply-To: <16967.1314717876@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.58 on oldperseverance.encs.concordia.ca at 2011/08/30 11:48:38 EDT 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/122 X-Sequence-Number: 35790 On 08/30/2011 11:24 AM, Tom Lane wrote: > 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%'])); Thank you Tom! If next version could have "not ilike ('', '')" added into window functions, that's will be great! Emi