Re: Using regexp_matches in the WHERE clause - Mailing list pgsql-sql

From Pavel Stehule
Subject Re: Using regexp_matches in the WHERE clause
Date
Msg-id CAFj8pRCpvb-V=wHKkfsb4i371nnWfEJAm06uxJzS-Qaknq88iQ@mail.gmail.com
Whole thread Raw
In response to Re: Using regexp_matches in the WHERE clause  (Thomas Kellerer <spam_eater@gmx.net>)
List pgsql-sql
2012/11/27 Thomas Kellerer <spam_eater@gmx.net>:
> Pavel Stehule, 27.11.2012 13:26:
>
>>> My question is: why I cannot use regexp_matches() in the WHERE clause,
>>> even
>>> when the result is clearly an integer value?
>>>
>>
>> use a ~ operator instead
>>
>
> So that means, regexp_matches cannot be used as an expression in the WHERE

should not be used - it is designed to return matched values, no for
returning true or false,

you can do some obscure
postgres=# select * from o where array(select
(regexp_matches(a,'ne'))[1]) <> '{}'::text[];  a
--------zdenek
(1 row)

but it is not recommended.

Regards

Pavel

> clause?
>
>
> Regards
> Thomas
>
>
>
>
>
> --
> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql



pgsql-sql by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: Using regexp_matches in the WHERE clause
Next
From: ssylla
Date:
Subject: output query on many to many relationship into several columns