problem with float8 input format

Поиск
Список
Период
Сортировка
От Louis-David Mitterrand
Тема problem with float8 input format
Дата
Msg-id 20000810172646.A2268@styx
обсуждение исходный текст
Ответы Re: problem with float8 input format  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hello,

Suddenly I am getting errors with the following function:

    SELECT incr(max_price($1),0.05)

    000810.17:20:41.181  [2246] ERROR:  Bad float8 input format '0.05'
    000810.17:20:41.181  [2246] AbortCurrentTransaction

Where incr() is defined as:

    CREATE FUNCTION "incr" (float8,float8 ) RETURNS float8 AS '
    SELECT CASE WHEN $1 < dpow(10,int8(log($1))+1)/2
        THEN (dpow(10,int8(log($1)))) * $2
        ELSE (dpow(10,int8(log($1))+1)/2) * $2
    END
    ' LANGUAGE 'SQL';

Strangely engough the function call works fine when called from psql but
fails (but not always!) from a C trigger.

Thanks in advance for any help,

--
Louis-David Mitterrand - ldm@apartia.org - http://www.apartia.org

  "Kill a man, and you are an assassin. Kill millions of men, and you
  are a conqueror. Kill everyone, and you are a god." -- Jean Rostand

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

Предыдущее
От: Mikhail Terekhov
Дата:
Сообщение: NOTIFY from PL/pgSQL trigger procedure
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: pg_dump and restore