Re: Dumb question about serial's upper limit

Поиск
Список
Период
Сортировка
От CSN
Тема Re: Dumb question about serial's upper limit
Дата
Msg-id 20051011050447.60835.qmail@web52911.mail.yahoo.com
обсуждение исходный текст
Ответ на Re: Dumb question about serial's upper limit  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Dumb question about serial's upper limit  (Michael Glaesemann <grzm@myrealbox.com>)
Список pgsql-general
--- Tom Lane <tgl@sss.pgh.pa.us> wrote:

> CSN <cool_screen_name90001@yahoo.com> 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 unsigned int type, we could use it for
> serial and get
> that result, but we do not.
>
>             regards, tom lane
>

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 workings):

PG int => C signed int
PG serial => C unsigned int

Anyhow, was just something I was curious about.

CSN




__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Oracle buys Innobase
Следующее
От: Gregory Wood
Дата:
Сообщение: Re: Oracle buys Innobase