Re: How to use like with a list - Mailing list pgsql-general

From John R Pierce
Subject Re: How to use like with a list
Date
Msg-id 4EC6C454.60400@hogranch.com
Whole thread Raw
In response to Re: How to use like with a list  ("Gauthier, Dave" <dave.gauthier@intel.com>)
Responses Re: operator precedence (was: How to use like with a list)  (John R Pierce <pierce@hogranch.com>)
Re: How to use like with a list  ("Gauthier, Dave" <dave.gauthier@intel.com>)
List 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


pgsql-general by date:

Previous
From: "Gauthier, Dave"
Date:
Subject: Re: How to use like with a list
Next
From: "David Johnston"
Date:
Subject: Re: How to use like with a list