problem with float8 input format - Mailing list pgsql-general

From Louis-David Mitterrand
Subject problem with float8 input format
Date
Msg-id 20000810172646.A2268@styx
Whole thread Raw
Responses Re: problem with float8 input format
List 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 by date:

Previous
From: Mikhail Terekhov
Date:
Subject: NOTIFY from PL/pgSQL trigger procedure
Next
From: Stephan Szabo
Date:
Subject: Re: pg_dump and restore