From: | David Johnston <polobo(at)yahoo(dot)com> |
---|---|
To: | Thomas Kellerer <spam_eater(at)gmx(dot)net> |
Cc: | "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org> |
Subject: | Re: Using regexp_matches in the WHERE clause |
Date: | 2012-11-27 14:22:08 |
Message-ID: | E72D307E-D276-4FF6-8E05-8434C6370AB8@yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
On Nov 26, 2012, at 7:13, Thomas Kellerer <spam_eater(at)gmx(dot)net> 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 what the problem is
> (although given the really cool array implementation in PostgreSQL I was a bit surprised).
>
regex_matches returns a set because you can supply the "g" option to capture all matches and each separate match returns its own record. Even though only one record is ever returned without the "g" option the function itself is the same and still is defined to return a set.
David J.
From | Date | Subject | |
---|---|---|---|
Next Message | Виктор Егоров | 2012-11-27 17:48:22 | Re: select on many-to-many relationship |
Previous Message | Pavel Stehule | 2012-11-27 12:35:48 | Re: Using regexp_matches in the WHERE clause |