Re: [GENERAL] 21 bit number for sequence

2006-04-18 Thread Shoaib Mir
Thanks Dawid. I also used something similar to that kind of approach and its working for me./ShoaibOn 4/18/06, Dawid Kuroczko < [EMAIL PROTECTED]> wrote:On 4/15/06, Shoaib Mir <[EMAIL PROTECTED]> wrote: Actually that is the application requirment to use 21 bit numbers as porting it from Oracle wh

Re: [GENERAL] 21 bit number for sequence

2006-04-17 Thread Dawid Kuroczko
On 4/15/06, Shoaib Mir <[EMAIL PROTECTED]> wrote: Actually that is the application requirment to use 21 bit numbers as porting it from Oracle where it used to work. Yeah now i have decided to use a numeric data type in a table and use that to write my own nextval and currval functions for that purp

Re: [GENERAL] 21 bit number for sequence

2006-04-15 Thread Tom Lane
Martijn van Oosterhout writes: > If you just want to store numbers, use numeric. Why do you want to > combine numeric and a sequence? He could use a numeric column and write the default as nextval('seq')::numeric Of course, he'll be paying through the nose performance-wise for his insist

Re: [GENERAL] 21 bit number for sequence

2006-04-15 Thread Christian Kratzer
Hi, On Sat, 15 Apr 2006, Shoaib Mir wrote: Actually that is the application requirment to use 21 bit numbers as porting it from Oracle where it used to work. 21 bits are no problem as bigints have 64 bits. If you mean decimal digits please explicitly say so. A bit is a binary digit. Yeah

Re: [GENERAL] 21 bit number for sequence

2006-04-15 Thread Shoaib Mir
Actually that is the application requirment to use 21 bit numbers as porting it from Oracle where it used to work. Yeah now i have decided to use a numeric data type in a table and use that to write my own nextval and currval functions for that purpose. Thanks for the help./ShoaibOn 4/15/06, Martij

Re: [GENERAL] 21 bit number for sequence

2006-04-15 Thread Martijn van Oosterhout
On Sat, Apr 15, 2006 at 12:52:49PM +0500, Shoaib Mir wrote: > Actually what i want to do is store 10010 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 requir

Re: [GENERAL] 21 bit number for sequence

2006-04-15 Thread Shoaib Mir
Actually what i want to do is store 10010 as the maximum value in sequence. Is there a way for it ?Thanks,ShoaibOn 4/15/06, Martijn van Oosterhout wrote:On Sat, Apr 15, 2006 at 10:24:59AM +0500, Shoaib Mir wrote: > Right now Sequence by default uses bigint which

Re: [GENERAL] 21 bit number for sequence

2006-04-15 Thread Martijn van Oosterhout
On Sat, Apr 15, 2006 at 10:24:59AM +0500, Shoaib Mir wrote: > Right now Sequence by default uses bigint which supports upto 19bit numbers > but I want to use a 21bit that can be supported by NUMERIC datatype. Is > there any way I can sepcify while creating a sequence what datatype to use > or if I