From: David G Johnston <david.g.johnston@gmail.com>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #10889: Cannot add 2 floats from regular expression
Date: Mon, 7 Jul 2014 08:58:26 -0700 (PDT)
Message-ID: <1404748706067-5810756.post@n5.nabble.com> (raw)
In-Reply-To: <23769.1404747766@sss.pgh.pa.us>
References: <20140707135824.2752.47779@wrigleys.postgresql.org>
<1404746726037-5810751.post@n5.nabble.com>
<23769.1404747766@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Tom Lane-2 wrote
> David G Johnston <
> david.g.johnston@
> > writes:
>> Suggest wrapping it in a function - or making a "regexp_matches_single"
>> function that behaves similarly but returns a single text[] instead of a
>> SETOF text[]
>
> I wonder if we should have such a thing built-in. This isn't the first
> complaint we've heard about the SETOF API being awkward to use, and it's
> only needed if you specify the 'g' flag. Perhaps we could have a variant
> that forbids 'g' and returns a non-set (either the single match, or NULL).
>
> regards, tom lane
+1
Given that regexp_matches is in core having this most useful API makes
perfect sense to me. Parsing out components from data is an extremely
common use-case for regexp - one that I personally encounter much more often
than needing global matching behavior.
I agree that the presence of the 'g' flag when calling regexp_matches_single
(_once?) should emit an error.
David J.
--
View this message in context: http://postgresql.1045698.n5.nabble.com/BUG-10889-Cannot-add-2-floats-from-regular-expression-tp5810...
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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: david.g.johnston@gmail.com
Subject: Re: BUG #10889: Cannot add 2 floats from regular expression
In-Reply-To: <1404748706067-5810756.post@n5.nabble.com>
References: <20140707135824.2752.47779@wrigleys.postgresql.org> <1404746726037-5810751.post@n5.nabble.com> <23769.1404747766@sss.pgh.pa.us> <1404748706067-5810756.post@n5.nabble.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