Skip site navigation (1) Skip section navigation (2)

Re: Numeric 508 datatype

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Numeric 508 datatype
Date: 2005-12-02 21:30:54
Message-ID: 7352.1133559054@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackerspgsql-patches
Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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

In response to

Responses

pgsql-hackers by date

Next:From: Alvaro HerreraDate: 2005-12-02 22:04:23
Subject: Re: Reducing relation locking overhead
Previous:From: Gregory MaxwellDate: 2005-12-02 21:23:27
Subject: Re: generalizing the planner knobs

pgsql-patches by date

Next:From: Michael FuhrDate: 2005-12-02 22:04:23
Subject: Re: Numeric 508 datatype
Previous:From: Bruce MomjianDate: 2005-12-02 21:19:20
Subject: Re: Numeric 508 datatype

pgsql-general by date

Next:From: Tony CadutoDate: 2005-12-02 21:43:57
Subject: Re: was a initdb required from 8.1beta3 -> beta4?
Previous:From: Bruce MomjianDate: 2005-12-02 21:19:20
Subject: Re: Numeric 508 datatype

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group