Re: Question with combining ANY with ilike - Mailing list pgsql-general

From Tom Lane
Subject Re: Question with combining ANY with ilike
Date
Msg-id 3871.1229087524@sss.pgh.pa.us
Whole thread Raw
In response to Question with combining ANY with ilike  (Rusty Conover <rconover@infogears.com>)
Responses Re: Question with combining ANY with ilike
List pgsql-general
Rusty Conover <rconover@infogears.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

pgsql-general by date:

Previous
From: Ivan Sergio Borgonovo
Date:
Subject: Re: create table as vs. create table like
Next
From: "Filip Rembiałkowski"
Date:
Subject: Re: Schemas and Privileges