Re: Numeric 508 datatype - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: Numeric 508 datatype
Date
Msg-id 200512022059.jB2Kxah20441@candle.pha.pa.us
Whole thread Raw
In response to Re: Numeric 508 datatype  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Numeric 508 datatype  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.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@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Numeric 508 datatype
Next
From: Simon Riggs
Date:
Subject: Re: Numeric 508 datatype