Re: Numeric 508 datatype - Mailing list pgsql-patches

From Tom Lane
Subject Re: Numeric 508 datatype
Date
Msg-id 7352.1133559054@sss.pgh.pa.us
Whole thread Raw
In response to Re: Numeric 508 datatype  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Numeric 508 datatype
List pgsql-patches
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Wow, check this out:
>     test=> SELECT CAST (pow(10::numeric, 10000) + 1 AS TEXT)
> It works fine!  I have all the digits, and the trailing 1.0:
>     000001.0000000000000000
> while SELECT pow(10::numeric, 10000) fails.

That's just about as wacky as can be, because numeric_text() is
implemented on top of numeric_out() ... there's no way that numeric_out
can be delivering the wrong answer if the cast produces the right text.
So somewhere between numeric_out and the delivery to the client,
something's getting confused.  I think it's time you got out your
debugger and started tracing through the backend ...

            regards, tom lane

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Numeric 508 datatype
Next
From: Michael Fuhr
Date:
Subject: Re: Numeric 508 datatype