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

Reply via email to