Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VF21s-0007A8-2Q for pgsql-sql@arkaria.postgresql.org; Thu, 29 Aug 2013 13:12:52 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VF21r-0001qY-DN for pgsql-sql@arkaria.postgresql.org; Thu, 29 Aug 2013 13:12:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VF21q-0001qN-Dl for pgsql-sql@postgresql.org; Thu, 29 Aug 2013 13:12:50 +0000 Received: from sam.nabble.com ([216.139.236.26]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VF21m-0004FA-GS for pgsql-sql@postgresql.org; Thu, 29 Aug 2013 13:12:50 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1VF21k-0003hX-H2 for pgsql-sql@postgresql.org; Thu, 29 Aug 2013 06:12:44 -0700 Date: Thu, 29 Aug 2013 06:12:44 -0700 (PDT) From: spulatkan To: pgsql-sql@postgresql.org Message-ID: <1377781964520-5768923.post@n5.nabble.com> In-Reply-To: References: Subject: Re: Using regexp_matches in the WHERE clause MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -0.1 (/) 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 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 not understand why array_length on where condition does not work for this. But maybe as it was pointed out, the return type is setof text[], that the result could have been like this (one row of data may result in multiple rows) If you have a regular expression that may end in one or more elements in the text[] then you may use inner query ps: last query is pointless as it will return 2 elements for each row (that matches the regular expression), but there may be a regular expression that may return one or more elements for each row -- View this message in context: http://postgresql.1045698.n5.nabble.com/Using-regexp-matches-in-the-WHERE-clause-tp5733684p5768923.html Sent from the PostgreSQL - sql mailing list archive at Nabble.com. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql