Re: BUG #10889: Cannot add 2 floats from regular expression

Поиск
Список
Период
Сортировка
От David G Johnston
Тема Re: BUG #10889: Cannot add 2 floats from regular expression
Дата
Msg-id 1404748706067-5810756.post@n5.nabble.com
обсуждение исходный текст
Ответ на Re: BUG #10889: Cannot add 2 floats from regular expression  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-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-tp5810748p5810756.html
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #10889: Cannot add 2 floats from regular expression
Следующее
От: Marko Tiikkaja
Дата:
Сообщение: Re: BUG #10889: Cannot add 2 floats from regular expression