Re: [GENERAL] Dumb question about serial's upper limit

2005-10-11 Thread Jim C. Nasby
On Tue, Oct 11, 2005 at 02:22:23AM -0400, Tom Lane wrote: > "Jim C. Nasby" <[EMAIL PROTECTED]> writes: > > Out of curiosity... why don't we have unsigned ints? > > Quick, is 42 an int or an unsigned int? > > I think it'd create a slew of new ambiguous cases in the > numeric-datatype hierarchy, fo

Re: [GENERAL] Dumb question about serial's upper limit

2005-10-11 Thread Jim C. Nasby
On Mon, Oct 10, 2005 at 11:52:40PM -0700, Dann Corbit wrote: > How about something like: > > CREATE DOMAIN unsigned_small AS smallint check (VALUE >= 0) > > CREATE DOMAIN unsigned_int AS integer check (VALUE >= 0) > > CREATE DOMAIN unsigned_big AS bigint check (VALUE >= 0) > > The objection mig

Re: [GENERAL] Dumb question about serial's upper limit

2005-10-11 Thread Dann Corbit
ostgresql.org > Subject: Re: [GENERAL] Dumb question about serial's upper limit > > On Mon, Oct 10, 2005 at 10:59:03PM -0400, Tom Lane wrote: > > CSN <[EMAIL PROTECTED]> writes: > > > If integer's range is -2147483648 to +2147483647, why > > > i

Re: [GENERAL] Dumb question about serial's upper limit

2005-10-10 Thread Michael Glaesemann
On Oct 11, 2005, at 15:12 , Jim C. Nasby wrote: Out of curiosity... why don't we have unsigned ints? I for one would certainly use them for id fields, as well as some other places where I knew negative numbers weren't valid. Check the archives. I know this has come up a number of times in the

Re: [GENERAL] Dumb question about serial's upper limit

2005-10-10 Thread Tom Lane
"Jim C. Nasby" <[EMAIL PROTECTED]> writes: > Out of curiosity... why don't we have unsigned ints? Quick, is 42 an int or an unsigned int? I think it'd create a slew of new ambiguous cases in the numeric-datatype hierarchy, for what is really pretty darn small gain. We're already just barely getti

Re: [GENERAL] Dumb question about serial's upper limit

2005-10-10 Thread Jim C. Nasby
On Mon, Oct 10, 2005 at 10:59:03PM -0400, Tom Lane wrote: > CSN <[EMAIL PROTECTED]> writes: > > If integer's range is -2147483648 to +2147483647, why > > is serial's range only 1 to 2147483647 instead of 1 to > > about 4294967294? > > How are you going to stuff 4294967294 into an integer field, wh

Re: [GENERAL] Dumb question about serial's upper limit

2005-10-10 Thread Michael Glaesemann
On Oct 11, 2005, at 14:04 , CSN wrote: I was thinking about the types in the C code behind PostgreSQL, rather than types in PG itself. Been a long time since I coded in C but I thought it had unsigned ints and maybe data types could be mapped as so (pardon my ignorance about C/PG's inner workin

Re: [GENERAL] Dumb question about serial's upper limit

2005-10-10 Thread CSN
--- Tom Lane <[EMAIL PROTECTED]> wrote: > CSN <[EMAIL PROTECTED]> writes: > > If integer's range is -2147483648 to +2147483647, > why > > is serial's range only 1 to 2147483647 instead of > 1 to > > about 4294967294? > > How are you going to stuff 4294967294 into an > integer field, which as > y

Re: [GENERAL] Dumb question about serial's upper limit

2005-10-10 Thread Tom Lane
CSN <[EMAIL PROTECTED]> writes: > If integer's range is -2147483648 to +2147483647, why > is serial's range only 1 to 2147483647 instead of 1 to > about 4294967294? How are you going to stuff 4294967294 into an integer field, which as you just stated has an upper limit of 2147483647? If we had an

[GENERAL] Dumb question about serial's upper limit

2005-10-10 Thread CSN
If integer's range is -2147483648 to +2147483647, why is serial's range only 1 to 2147483647 instead of 1 to about 4294967294? CSN __ Yahoo! Music Unlimited Access over 1 million songs. Try it free. http://music.yahoo.com/unlimited/ ---