Re: SERIAL datatype

From: Alban Hertroys <dalroi(at)solfertje(dot)student(dot)utwente(dot)nl>
To: Peter Billen <peter(at)clueless(dot)be>
Cc: ries van Twisk <pg(at)rvt(dot)dds(dot)nl>, pgsql-general(at)postgresql(dot)org
Subject: Re: SERIAL datatype
Date: 2008-08-24 11:54:52
Message-ID: A3D17CAA-E5B1-4812-B836-6ADDEB221FC6@solfertje.student.utwente.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Aug 21, 2008, at 9:51 PM, Peter Billen wrote:

> My concern is not that the table will become full, but that the
> sequence will be exhausted. Doing INSERT, DELETE, INSERT,
> DELETE ... will exhaust the sequence. What will happen then? Do I
> have to manually re-order my serial values and reset the start
> sequence ID to MAX() + 1?

DELETEs don't use your sequence so will not exhaust it. In practice
only INSERTs do. I saw you mention sequences in combination with
DELETEs a few times, just making sure you're not confused ;)

Alban Hertroys

--
If you can't see the forest for the trees,
cut the trees and you'll see there is no forest.

!DSPAM:737,48b14c10243481755132881!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stefan 'Kaishakunin' Schumacher 2008-08-24 18:28:04 Re: Array, ANY and Regular Expressions
Previous Message Alban Hertroys 2008-08-24 11:37:11 Re: on delete cascade slowing down delete