Re: Question with combining ANY with ilike

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rusty Conover <rconover(at)infogears(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Question with combining ANY with ilike
Date: 2008-12-12 13:12:04
Message-ID: 3871.1229087524@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Rusty Conover <rconover(at)infogears(dot)com> writes:
> I'd like to specify a pattern then apply that pattern to match each
> element of an array:

> rconover=# select 'foobar%' ~~ ANY (ARRAY['bar', 'cat', 'foobar:asdf']);
> ?column?
> ----------
> f
> (1 row)

> I'd like the the pattern would be evaluated against all of the array
> elements, but the order of parameters for the ~~ operator when
> combined with the ANY command is backwards to what I need.

Create a reverse-LIKE operator and underlying one-line SQL function.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Filip Rembiałkowski 2008-12-12 13:51:27 Re: Schemas and Privileges
Previous Message Ivan Sergio Borgonovo 2008-12-12 13:07:54 Re: create table as vs. create table like