Re: Reduce NUMERIC size by 2 bytes, reduce max length to 508 digits

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Simon Riggs <simon(at)2ndquadrant(dot)com>, PostgreSQL-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Reduce NUMERIC size by 2 bytes, reduce max length to 508 digits
Date: 2005-12-03 21:30:00
Message-ID: 20051203213000.GA27769@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-patches

On Sat, Dec 03, 2005 at 11:43:00 -0500,
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> > On Fri, Dec 02, 2005 at 07:37:49PM -0500, Tom Lane wrote:
> >> So the product I fancifully mentioned would weigh in somewhere around
> >> 10^300, and thus be *well* within the capability of even the proposed
> >> restricted numeric format.
>
> > I think numbers much bigger than that are only useful for theoretical
> > mathemeticians.
>
> There are practical applications, eg, 1024-bit keys are fairly common
> objects in cryptography these days, and that equates to about 10^308.
> I don't really foresee anyone trying to run crypto algorithms with SQL
> NUMERIC arithmetic, though ...

2046 bit keys are becoming more common. However, math using these keys is
usually done modulo a product of two primes and there are ways of doing the
calculations that are going to be much faster than doing them the way
Postgres does. So it is unlikely that anyone would be using Postgres' numeric
type to do this in any case.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rodrigo Gonzalez 2005-12-03 22:38:20 Re: beginne' - inserting a record
Previous Message Andreas Kretschmer 2005-12-03 21:21:09 Re: beginne' - inserting a record

Browse pgsql-hackers by date

  From Date Subject
Next Message Tino Wildenhain 2005-12-03 21:37:34 Re: SERIAL type feature request
Previous Message Zoltan Boszormenyi 2005-12-03 21:23:44 SERIAL type feature request

Browse pgsql-patches by date

  From Date Subject
Next Message Kris Jurka 2005-12-04 00:53:23 date overflows
Previous Message Nicolai Tufar 2005-12-03 19:26:45 Re: [HACKERS] snprintf() argument reordering not working under Windows in 8.1