From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Vee <sefer@hotmail.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #5273: Unexpected function behavior/failure
Date: Tue, 12 Jan 2010 20:48:36 -0500
Message-ID: <603c8f071001121748u1dd53f7ai2fe60a310d500019@mail.gmail.com> (raw)
In-Reply-To: <29476.1263343544@sss.pgh.pa.us>
References: <201001122230.o0CMUWFS000320@wwwmaster.postgresql.org>
<29476.1263343544@sss.pgh.pa.us>
On Tue, Jan 12, 2010 at 7:45 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> "Vee" <sefer@hotmail.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: robertmhaas@gmail.com, tgl@sss.pgh.pa.us, sefer@hotmail.com
Subject: Re: BUG #5273: Unexpected function behavior/failure
In-Reply-To: <603c8f071001121748u1dd53f7ai2fe60a310d500019@mail.gmail.com>
References: <201001122230.o0CMUWFS000320@wwwmaster.postgresql.org> <29476.1263343544@sss.pgh.pa.us> <603c8f071001121748u1dd53f7ai2fe60a310d500019@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox