Re: How to use like with a list

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How to use like with a list
Date: 2011-11-18 20:47:16
Message-ID: 4EC6C454.60400@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/18/11 12:37 PM, Gauthier, Dave wrote:
> bi_dev=# select name from test where name ~ '^(' || replace('jo,mo,do,fo', ',', '|') || ')l';
> ERROR: argument of WHERE must be type boolean, not type text

ah, needs () around the right side of the ~ expression, not sure why.
does ~ have higher expression priority than || or something?

select name from test where name ~ ('^(' || replace(?, ',', '|') || ')l');

worked for me.

--
john r pierce N 37, W 122
santa cruz ca mid-left coast

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Johnston 2011-11-18 20:58:52 Re: How to use like with a list
Previous Message Gauthier, Dave 2011-11-18 20:37:18 Re: How to use like with a list