Grokbase
x

Re: Auto incrementing primary keys

View PostFlat  Thread  Threaded | < Prev - Next >
Raymond O'Donnell Re: [GENERAL] Auto incrementing primary keys
| +1 vote
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
On 18/02/2008 17:46, Raymond O'Donnell wrote:

> Well, that depends on your usage, so only you can answer that. According
> to the docs, "serial" creates an integer column, which will give you
> 2147483647 values - how quickly will you use that lot up? If you think
> you will run out, by all means use bigserial.

Actually, that isn't quite right - just looked at the docs for CREATE
SEQUENCE, and the default maximum value is 2^63-1.

Ray.

---------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
[email protected: r...@iol.ie]
---------------------------------------------------------------

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Thread : Re: Auto incrementing primary keys
1)
Paul Boddie "Auto-incrementing" columns, typically implemented using the serial data type [1], employ...
2)
pgsql_user so wouldnt I run out of ids one day, if there are lot of failed insert statements, lets say for...
3)
Raymond O'Donnell Well, that depends on your usage, so only you can answer that. According to the docs, "serial"...
4)
Raymond O'Donnell Actually, that isn't quite right - just looked at the docs for CREATE SEQUENCE, and the default...
5)
Steve Atkins That's the maximum value for the sequence itself, but a "serial" is just an integer, so the 2^31-1...
6)
Scott Marlowe Look up bigserial ---------------------------(end of broadcast)--------------------------- TIP 4:...
7)
Reid Thompson http://www.google.com/search?q=2147483647+seconds+to...
8)
Gordon In theory, yes. but the standard 4 byte integer can represent about 2 billion positive numbers so...
9)
Lew First of all, sequenced keys are an artificial (surrogate) key. They should carry no meaning...
spacer
View PostFlat  Thread  Threaded | < Prev - Next >