Re: Numeric 508 datatype

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, 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 22:04:23
Message-ID: 20051202220423.GA35126@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-patches

On Fri, Dec 02, 2005 at 04:30:54PM -0500, Tom Lane wrote:
> 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 ...

Bruce, have you run a process trace on the backend to see if write()
(or whatever) is writing the correct number of characters? What
exactly is your output device and how are you connected to the
machine that runs the backend (ssh to a remote box from an xterm,
sitting in front of the box's VT52 serial console, etc.)?

If you run the query that fails in a standalone backend, do you get
something like "(typeid = 1700, len = -1, typmod = -1, byval = f)"
at the end of the line, or is that part truncated too?

--
Michael Fuhr

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2005-12-02 22:08:43 Re: was a initdb required from 8.1beta3 -> beta4?
Previous Message Tony Caduto 2005-12-02 22:03:27 was a initdb required from 8.1beta3 -> beta4?

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Sullivan 2005-12-02 22:07:22 Re: Please let us know if you will come to the PostgreSQL Anniversary
Previous Message Tom Lane 2005-12-02 21:30:54 Re: Numeric 508 datatype

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2005-12-02 22:11:13 Re: Numeric 508 datatype
Previous Message Tom Lane 2005-12-02 21:30:54 Re: Numeric 508 datatype