Re: Using regexp_matches in the WHERE clause - Mailing list pgsql-sql

From spulatkan
Subject Re: Using regexp_matches in the WHERE clause
Date
Msg-id 1377781964520-5768923.post@n5.nabble.com
Whole thread Raw
In response to Re: Using regexp_matches in the WHERE clause  (David Johnston <polobo@yahoo.com>)
Responses Re: Using regexp_matches in the WHERE clause
List pgsql-sql
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.



pgsql-sql by date:

Previous
From: Luca Ferrari
Date:
Subject: Re: CTAGS for PL/pgSQL ?
Next
From: Charles Sheridan
Date:
Subject: Re: CTAGS for PL/pgSQL ?