Re: Auto incrementing primary keys

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: pgsql_user <amaltasb(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Auto incrementing primary keys
Date: 2008-02-18 17:46:16
Message-ID: 47B9C468.7070605@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 18/02/2008 13:14, pgsql_user wrote:
> so wouldnt I run out of ids one day, if there are lot of failed insert
> statements, lets say for every successful insert there are 50
> unsuccessful inserts, so ids would be 1, 50, 100, and once I have
> thousands of rows, I will run out of IDs ? should I use bigserial
> instead ?

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.

Ray.

---------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod(at)iol(dot)ie
---------------------------------------------------------------

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Fetter 2008-02-18 17:55:30 Re: Initdb failed in PostgreSQL 7.3.21
Previous Message Erik Jones 2008-02-18 17:42:59 Re: questions about very large table and partitioning