regexp_matches illegally restricts rows - Mailing list pgsql-bugs

From Josh Berkus
Subject regexp_matches illegally restricts rows
Date
Msg-id 4BBAB597.6000409@agliodbs.com
Whole thread Raw
Responses Re: regexp_matches illegally restricts rows -- just a documentation issue?  (Josh Berkus <josh@postgresql.org>)
List pgsql-bugs
Severity: major (data loss)
Versions Tested: 8.4.2, 9.0 HEAD
Test Case:

create table regex_test ( id serial not null primary key, myname text );

insert into regex_test ( myname )
values ( 'josh'),('joe'),('mary'),('stephen'), ('jose'),
('kelley'),('alejandro');

select id, regexp_matches(myname, $x$(j[\w]+)$x$)
from regex_test;

The above will return 4 rows, not the 7 which are in the table.

I can't see how this is anything but a bug; as far as I know, nothing in
the target list is allowed to restrict the number of rows which are
returned by the query.  We should get 7 rows, 3 of which have an empty
array or a NULL in the 2nd column.

--
                                  -- Josh Berkus
                                     PostgreSQL Experts Inc.
                                     http://www.pgexperts.com

pgsql-bugs by date:

Previous
From: Robert Haas
Date:
Subject: Re: dividing money by money
Next
From: Josh Berkus
Date:
Subject: Re: regexp_matches illegally restricts rows -- just a documentation issue?