Re: 21 bit number for sequence

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: 21 bit number for sequence
Дата
Msg-id 20060415080150.GC22736@svana.org
обсуждение исходный текст
Ответ на Re: 21 bit number for sequence  ("Shoaib Mir" <shoaibmir@gmail.com>)
Ответы Re: 21 bit number for sequence  ("Shoaib Mir" <shoaibmir@gmail.com>)
Re: 21 bit number for sequence  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On Sat, Apr 15, 2006 at 12:52:49PM +0500, Shoaib Mir wrote:
> Actually what i want to do is store 100000000000000100000 as the maximum
> value in sequence. Is there a way for it ?

Is that number in binary or decimal? In binary it's easy because it's
only 1048608 decimal. In decimal it would require 66 bits, which
doesn't fit. The is still: why do you want a *sequence* to go that
high? A sequence starts counting a 1 and goes up until the limit. At
one count per second you'd take several million million years to get
though. Bigint indeed only goes upto 9223372036854775807.

If you just want to store numbers, use numeric. Why do you want to
combine numeric and a sequence?
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: "Shoaib Mir"
Дата:
Сообщение: Re: 21 bit number for sequence
Следующее
От: "Shoaib Mir"
Дата:
Сообщение: Re: 21 bit number for sequence