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: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Numeric 508 datatype
Date: 2005-12-02 16:47:22
Message-ID: 200512021647.jB2GlME10341@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackerspgsql-patches
Simon Riggs wrote:
> 
> Now we're into 8.2devel mode, its time to submit the previously
> discussed patch that:
> 
> - reduces Numeric storage format by 2 bytes
> - limits scale to +/- 508 decimal places
> 
> This is sufficient to allow Numeric to continue to be used as the
> default numeric representation for all numbers in the parser.
> 
> Passes: make check on cvstip, as well as some tests not in there.
> 
> Code comments explain the new format and consequences.
> 
> As previously agreed, reviewing this is a 2 stage process:
> 1. review/possibly agree OK to commit
> 2. check with everybody on GENERAL that the restriction to 508 is
> acceptable
> 
> Figure there's no point doing (2) until we agree the proposal/code is
> workable.

OK, seems all objections have been dealt with so it goes into the patch
queue.  I will ask on 'general'.

The only downside I see is that I can't impress people by doing:

	SELECT factorial(4000);

I don't suppose the _impression_ factor is worth two bytes per value. 
Shame.

I suppose people wanting to do such manipulations will have to store the
numbers as text and use a server-side library like perl to do
calculations.

-- 
  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: Chris BrowneDate: 2005-12-02 17:14:09
Subject: Re: [HACKERS] Should libedit be preferred to libreadline?
Previous:From: Tom LaneDate: 2005-12-02 15:42:48
Subject: Re: Optimizer oddness, possibly compounded in 8.1

pgsql-patches by date

Next:From: Chris BrowneDate: 2005-12-02 17:14:09
Subject: Re: [HACKERS] Should libedit be preferred to libreadline?
Previous:From: Joshua D. DrakeDate: 2005-12-02 16:17:02
Subject: Re: Check for integer overflow in datetime functions

pgsql-general by date

Next:From: Rodrigo GonzalezDate: 2005-12-02 16:49:42
Subject: Re: Slow COUNT
Previous:From: Andrew SchmidtDate: 2005-12-02 16:01:27
Subject: Re: Slow COUNT

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