BUG #10889: Cannot add 2 floats from regular expression

Поиск
Список
Период
Сортировка
От jakub.vrbas@inspire.cz
Тема BUG #10889: Cannot add 2 floats from regular expression
Дата
Msg-id 20140707135824.2752.47779@wrigleys.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #10889: Cannot add 2 floats from regular expression  (David G Johnston <david.g.johnston@gmail.com>)
Список pgsql-bugs
The following bug has been logged on the website:

Bug reference:      10889
Logged by:          Jakub Vrbas
Email address:      jakub.vrbas@inspire.cz
PostgreSQL version: 9.1.13
Operating system:   Debian
Description:

I have test_column (of type character varying). If I parse a float by
regular expression, it isn't possible to add it to another float from
regular expression.

Example:

SELECT
    (regexp_matches(test_column, '([0-9\.]*)'))[1]::float
    +
    (regexp_matches(test_column, '([0-9\.]*)'))[1]::float
FROM test_table

Results in "ERROR:  functions and operators can take at most one set
argument"

Example 2 is OK:
SELECT
    float_column
    +
    float_column
FROM (
    SELECT
    (regexp_matches(test_column, '([0-9\.]*)'))[1]::float AS float_column
    FROM test_table
) foo

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

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: Postgresql database error in data retrive
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #10888: application is getting hanged in the poll() function of libpq.so.