pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedFrom: David Johnston <polobo@yahoo.com>
To: Thomas Kellerer <spam_eater@gmx.net>
Cc: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Subject: Re: Using regexp_matches in the WHERE clause
Date: Tue, 27 Nov 2012 09:22:08 -0500
Message-ID: <E72D307E-D276-4FF6-8E05-8434C6370AB8@yahoo.com> (raw)
In-Reply-To: <k8vmbm$1fg$1@ger.gmane.org>
References: <k8vmbm$1fg$1@ger.gmane.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-sql>
On Nov 26, 2012, at 7:13, Thomas Kellerer <spam_eater@gmx.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.
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
view thread (9+ messages) latest in thread
Message-ID: <E72D307E-D276-4FF6-8E05-8434C6370AB8@yahoo.com>
Permalink: ../E72D307E-D276-4FF6-8E05-8434C6370AB8@yahoo.com/
Also on: postgresql.org/message-id/E72D307E-D276-4FF6-8E05-8434C6370AB8@yahoo.com
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: polobo@yahoo.com, spam_eater@gmx.net
Subject: Re: Using regexp_matches in the WHERE clause
In-Reply-To: <E72D307E-D276-4FF6-8E05-8434C6370AB8@yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox