Serial datatype clarification

Поиск
Список
Период
Сортировка
Искать

Serial datatype clarification

От:
"Pradeepkumar, Pyatalo (IE10)" <Pradeepkumar.Pyatalo@honeywell.com>
Дата:
Hi,
        I just wanted to clarify as to what is the maximum value of a SERIAL datatype. In the documentation it is given that with BIGSERIAL it is possible to generate 2pow(31) identifiers. What is the maximum value of a SERIAL datatype, and what would happen if I insert a record after the maximum value is reached.
 
With Best Regards
Pradeep Kumar P J

Re: Serial datatype clarification

От:
Josh Berkus <josh@agliodbs.com>
Дата:
Pradeep,

>         I just wanted to clarify as to what is the maximum value of a
> SERIAL datatype. In the documentation it is given that with BIGSERIAL it is
> possible to generate 2pow(31) identifiers. 

Nope, that would be regular SERIAL.  BIGSSERIAL is 2^62 or so.

> What is the maximum value of a 
> SERIAL datatype, and what would happen if I insert a record after the
> maximum value is reached.

You'd get an error.   A SERIAL field is just an INT field; it's not going to 
accept out-of-range values.

-- 
--Josh

Josh Berkus
Aglio Database Solutions
San Francisco
FAQ