Re: Adding unsigned 256 bit integers

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Olivier Lalonde <olalonde(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Adding unsigned 256 bit integers
Date: 2014-04-10 13:26:46
Message-ID: 53469C16.2020103@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 04/10/2014 09:13 AM, Olivier Lalonde wrote:
> I was wondering if there would be any way to do the following in
> PostgreSQL:
>
> UPDATE cryptotable SET work = work + 'some big hexadecimal number'
>
> where work is an unsigned 256 bit integer. Right now my column is a
> character varying(64) column (hexadecimal representation of the
> number) but I would be happy to switch to another data type if it lets
> me do the operation above.
>
> If it's not possible with vanilla PostgreSQL, are there extensions
> that could help me?
>
>

The numeric type allows numbers with huge numbers of digits. I've used
it to calculate fibonacci numbers thousands of digits long.

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2014-04-10 13:41:07 Re: Adding unsigned 256 bit integers
Previous Message Tom Lane 2014-04-10 13:25:31 Re: Get more from indices.