Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Tom Lane wrote:
> >> 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.
> 
> Curiouser and curiouser.  How about if you repeat 4k or 8k '1's?  If the

1's print just fine too.

> behavior is different for letters and digits then I'd look at the column
> justification logic in psql's printing code.

Again, I checked on a stand-alone backend and saw the same failures, so
it isn't psql.

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.

-- 
  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

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Reply via email to