Re: Numeric 508 datatype

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(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 20:59:36
Message-ID: 200512022059.jB2Kxah20441@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-patches

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > I just tested from a standalone backend:
> > backend> select pow(10::numeric, 131071) + 1
> > and got 4095 zeros and no trailing '1' (wrong), so it isn't psql, it
> > must be something in the backend.
>
> If the backend is truncating the result length, I don't see why psql
> would decide it needs 12K dashes for the header. There's something
> awfully fishy going on in your machine.
>
> Try something like
>
> regression=# select length((pow(10::numeric, 131071))::text);
> length
> --------
> 131089
> (1 row)
>
> If that gives the right answer then the NUMERIC code is off the hook,
> and what you've got is a strange limitation on output column length.

test=> select length((pow(10::numeric, 131071))::text);
length
--------
131089
(1 row)

Looks good. From psql I just tried:

SELECT repeat('x', 4000);

and got 4k x's, and SELECT repeat('x', 8000) returns 8k x's, so that works.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Simon Riggs 2005-12-02 21:01:32 Re: Numeric 508 datatype
Previous Message Tom Lane 2005-12-02 20:55:46 Re: Numeric 508 datatype

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2005-12-02 21:01:32 Re: Numeric 508 datatype
Previous Message Tom Lane 2005-12-02 20:55:46 Re: Numeric 508 datatype

Browse pgsql-patches by date

  From Date Subject
Next Message Simon Riggs 2005-12-02 21:01:32 Re: Numeric 508 datatype
Previous Message Tom Lane 2005-12-02 20:55:46 Re: Numeric 508 datatype