Skip site navigation (1) Skip section navigation (2)

Re: Serial datatype clarification

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: "Pradeepkumar, Pyatalo (IE10)" <Pradeepkumar(dot)Pyatalo(at)honeywell(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Serial datatype clarification
Date: 2004-09-14 23:07:16
Message-ID: 200409141607.17010.josh@agliodbs.com (view raw or flat)
Thread:
Lists: pgsql-novice
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

In response to

pgsql-novice by date

Next:From: Josh BerkusDate: 2004-09-14 23:18:18
Subject: Re: can I define a hyperlink as a datatype
Previous:From: Stephan SzaboDate: 2004-09-14 21:55:25
Subject: Re: Create table error

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group