Re: where col1 not ilike ('str1%', 'str2%'... 'strN%') support?

From: Emi Lu <emilu(at)encs(dot)concordia(dot)ca>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: where col1 not ilike ('str1%', 'str2%'... 'strN%') support?
Date: 2011-08-30 15:48:38
Message-ID: 4E5D0656.8090709@encs.concordia.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 08/30/2011 11:24 AM, Tom Lane wrote:
> Emi Lu<emilu(at)encs(dot)concordia(dot)ca> 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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2011-08-30 15:53:16 Re: where col1 not ilike ('str1%', 'str2%'... 'strN%') support?
Previous Message Tom Lane 2011-08-30 15:24:36 Re: where col1 not ilike ('str1%', 'str2%'... 'strN%') support?