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

Поиск
Список
Период
Сортировка
От Marko Tiikkaja
Тема Re: BUG #10889: Cannot add 2 floats from regular expression
Дата
Msg-id 53BACC90.3080609@joh.to
обсуждение исходный текст
Ответ на Re: BUG #10889: Cannot add 2 floats from regular expression  (David G Johnston <david.g.johnston@gmail.com>)
Список pgsql-bugs
On 7/7/14 5:25 PM, David G Johnston wrote:
> SELECT
> (SELECT (regexp_matches('1.3', '([0-9\.]*)'))[1])::float
> +
> (SELECT (regexp_matches('2.3', '([0-9\.]*)'))[1])::float
> ;
>
> 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[]

In this case, it would be easier to use  substring(string from pattern).


.marko

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

Предыдущее
От: David G Johnston
Дата:
Сообщение: Re: BUG #10889: Cannot add 2 floats from regular expression
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #10888: application is getting hanged in the poll() function of libpq.so.