regexp_matches bug in 9.3.4 and 9.4.1 - Mailing list pgsql-bugs

From Jeff Certain
Subject regexp_matches bug in 9.3.4 and 9.4.1
Date
Msg-id BN1PR04MB37467AA1D412223B3D4A595DFD20@BN1PR04MB374.namprd04.prod.outlook.com
Whole thread Raw
Responses Re: regexp_matches bug in 9.3.4 and 9.4.1
Re: regexp_matches bug in 9.3.4 and 9.4.1
List pgsql-bugs
Repro:
drop table if exists regex_test;
create table regex_test(filter citext);
insert into regex_test(filter) values ('Filter Filter Filter');
select filter, regexp_matches(filter, 'Filter', 'g') from regex_test;
select filter, regexp_matches('Filter Filter Filter', 'Filter', 'g') from r=
egex_test;

Expected result:
Both select statements should return the same number of rows. Specifically,=
 in this case, I expect to get back 3 rows.

Actual result:
When referencing the filter column, only one row is ever returned. When sup=
plying the string that is the same as the data in the filter column, the co=
rrect number of rows are returned.

Result 1 (incorrect):
select filter, regexp_matches(filter, 'Filter', 'g') from regex_test;
Filter Filter Filter               {Filter}

Result 2 (correct):
select filter, regexp_matches('Filter Filter Filter', 'Filter', 'g') from r=
egex_test;
Filter Filter Filter               {Filter}
Filter Filter Filter               {Filter}
Filter Filter Filter               {Filter}

Versions
PostgreSQL 9.3.4, compiled by Visual C++ build 1600, 64-bit
PostgreSQL 9.4.1 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.4.7 2=
0120313 (Red Hat 4.4.7-11), 64-bit

pgsql-bugs by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Re: BUG #12990: Missing pg_multixact/members files (appears to have wrapped, then truncated)
Next
From: "David G. Johnston"
Date:
Subject: Re: regexp_matches bug in 9.3.4 and 9.4.1