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

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 21:19:20
Message-ID: 200512022119.jB2LJKA23262@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackerspgsql-patches
Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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(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

pgsql-hackers by date

Next:From: Gregory MaxwellDate: 2005-12-02 21:23:27
Subject: Re: generalizing the planner knobs
Previous:From: Tom LaneDate: 2005-12-02 21:10:22
Subject: Re: Numeric 508 datatype

pgsql-patches by date

Next:From: Tom LaneDate: 2005-12-02 21:30:54
Subject: Re: Numeric 508 datatype
Previous:From: Tom LaneDate: 2005-12-02 21:10:22
Subject: Re: Numeric 508 datatype

pgsql-general by date

Next:From: Tom LaneDate: 2005-12-02 21:30:54
Subject: Re: Numeric 508 datatype
Previous:From: Tom LaneDate: 2005-12-02 21:10:22
Subject: Re: Numeric 508 datatype

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