Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TdM38-0008Hi-4q for pgsql-sql@arkaria.postgresql.org; Tue, 27 Nov 2012 14:22:10 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TdM37-0003JT-Jd for pgsql-sql@arkaria.postgresql.org; Tue, 27 Nov 2012 14:22:09 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TdM36-0003IU-Ay for pgsql-sql@postgresql.org; Tue, 27 Nov 2012 14:22:08 +0000 Received: from nm35.bullet.mail.bf1.yahoo.com ([72.30.238.197]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TdM34-00085v-Q4 for pgsql-sql@postgresql.org; Tue, 27 Nov 2012 14:22:07 +0000 Received: from [98.139.215.143] by nm35.bullet.mail.bf1.yahoo.com with NNFMP; 27 Nov 2012 14:22:05 -0000 Received: from [98.136.87.25] by tm14.bullet.mail.bf1.yahoo.com with NNFMP; 27 Nov 2012 14:22:05 -0000 Received: from [127.0.0.1] by smtp120-mob.biz.mail.ac4.yahoo.com with NNFMP; 27 Nov 2012 14:22:05 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1354026125; bh=CekQgc4TLotS17m9ACUvSl3qFvWpT9SwaUnn4GYg8Cg=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:References:In-Reply-To:Mime-Version:Content-Transfer-Encoding:Content-Type:Message-Id:Cc:X-Mailer:From:Subject:Date:To; b=iDjF8/G8Q+QuEhiI87ivj8sF4vI6YZm3CQq66kBb+NFnuhrFecDSX6Kwf5mYR6ID1qK7rYowlztwAw+84nNlqjaAnuh3C4QfXm0rCk8HkX5lYcUGGrM1c3hE48OuVvMuU50eVtZYqUNjrZDC81NMQnFUGVJRmTq3vlYFCuK2OoM= X-Yahoo-Newman-Id: 600616.96668.bm@smtp120-mob.biz.mail.ac4.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: f4UlWxMVM1lUnWCVp04l7CuwyaZuOzx8a9acSuT2_RSoFBS uCDz3up0a7_Pe4VOVLzoHX7peDglFOow1iYiUXtzWUUE3Qvvl4h1hHCn7OFM AkP0a4sWlab_kdgm9qorUosKK8MDS34wvyZgnpc.H7Jif_HdeeocTrYkTwG4 lLACY.5UNDEPbT2NF14VbYav2m5bpI7qP7jFqmusC_kK8E20XgZzbb9wju_x C5oJfApp.7OLYjFOAZ3hrUzbvCfDIul9ZoZRQPAyAbvC.iKhehEnPYDH.m8. F0kDdoLc_MO879bsvJBm1xhsRJp60.JM5AuJu4rQa2MKHLQ8ZL.OIMUXkyq4 otUWxYKqmvK6m7Vpa4_fKhiT18a1rT_bSlr6rBZ_Yi4sXzT2oqNywajCPMWy OCVYWsrKD4PVoOb1W_fdmQTDxO36x_0rb6JxWjZowltEi86J83mxaZ9fiBof YO2H. X-Yahoo-SMTP: mpGJl6eswBD2IBufoVEg0Pa8gg-- Received: from [192.12.17.101] (polobo@24.93.23.188 with xymcookie) by smtp120-mob.biz.mail.ac4.yahoo.com with SMTP; 27 Nov 2012 06:22:05 -0800 PST References: In-Reply-To: Mime-Version: 1.0 (1.0) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-Id: Cc: "pgsql-sql@postgresql.org" X-Mailer: iPad Mail (9B206) From: David Johnston Subject: Re: Using regexp_matches in the WHERE clause Date: Tue, 27 Nov 2012 09:22:08 -0500 To: Thomas Kellerer X-Pg-Spam-Score: -0.9 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org On Nov 26, 2012, at 7:13, Thomas Kellerer wrote: >=20 > So I tried: >=20 > SELECT * > FROM some_table > WHERE regexp_matches(somecol, 'foobar') is not null; >=20 > However that resulted in: ERROR: argument of WHERE must not return a set >=20 > 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). >=20 regex_matches returns a set because you can supply the "g" option to captur= e 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. --=20 Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql