spulatkan wrote
> so following is enough to get the rows that matches regular expression
>
This is bad form even if it works. If the only point of the expression is
to filter rows it should appear in the WHERE clause. The fact that
regexp_matches(...) behaves in this way at all is, IMO, a flaw
I noticed that regexp_matches already returns the rows which matches the
regular expression
now when I make a full table select query
but if I make a search with regexp_matches, it only returns rows that
matches regular expression
on pgadmin the column type is shown as text[] thus I also do no
On Nov 26, 2012, at 7:13, Thomas Kellerer wrote:
>
> So I tried:
>
> SELECT *
> FROM some_table
> WHERE regexp_matches(somecol, 'foobar') is not null;
>
> However that resulted in: ERROR: argument of WHERE must not return a set
>
> Hmm, even though an array is not a set I can partly see
2012/11/27 Thomas Kellerer :
> 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 express
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
clause?
Regards
Thomas
--
Sent
Hello
2012/11/27 Thomas Kellerer :
>> > So I tried:
>> >
>> > SELECT *
>> > FROM some_table
>> > WHERE regexp_matches(somecol, 'foobar') is not null;
>> >
>> > However that resulted in: ERROR: argument of WHERE must not return a
>> set
>> >
>> > Hmm, even though an array is not a set I ca
> So I tried:
>
> SELECT *
> FROM some_table
> WHERE regexp_matches(somecol, 'foobar') is not null;
>
> However that resulted in: ERROR: argument of WHERE must not return a set
>
> Hmm, even though an array is not a set I can partly see what the problem is
> (although given the really co
Sounds to me like this:
http://joecelkothesqlapprentice.blogspot.nl/2007/12/using-where-clause-parameter.html
> To: pgsql-sql@postgresql.org
> From: spam_ea...@gmx.net
> Subject: [SQL] Using regexp_matches in the WHERE clause
> Date: Mon, 26 Nov 2012 13:13:06 +0100
>
Hi,
I stumbled over this question on Stackoverflow
http://stackoverflow.com/questions/13564369/postgresql-using-column-data-as-pattern-for-regexp-match
And my initial reaction was, that this should be possible using regexp_matches.
So I tried:
SELECT *
FROM some_table
WHERE regex