| From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
| Cc: | Vee <sefer(at)hotmail(dot)com>, pgsql-bugs(at)postgresql(dot)org |
| Subject: | Re: BUG #5273: Unexpected function behavior/failure |
| Date: | 2010-01-13 01:48:36 |
| Message-ID: | 603c8f071001121748u1dd53f7ai2fe60a310d500019@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
On Tue, Jan 12, 2010 at 7:45 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "Vee" <sefer(at)hotmail(dot)com> writes:
>> -- The problem query
>> select data, regexp_matches(data, '(h..l)')
>> from test;
>
>>> hello {hell}
>
>> Since I have no "where" clause, I would expect to see all the rows in the
>> result of the second case, with possibly a NULL value for the non-matched
>> rows.
>
> No. regexp_matches() returns setof something, meaning a row per match.
> When you have no match, you get no rows. And that in turn means that
> the calling select produces no rows --- just as it could also produce
> more than one row from a given table row.
>
> I think the behavior you are after is probably more like that of
> substring().
Or maybe the ~ operator.
...Robert
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2010-01-13 04:53:48 | Re: BUG #5269: postgres backend terminates with SIGSEGV |
| Previous Message | Tom Lane | 2010-01-13 00:45:44 | Re: BUG #5273: Unexpected function behavior/failure |