Re: SERIAL datatype - Mailing list pgsql-general

From Sam Mason
Subject Re: SERIAL datatype
Date
Msg-id 20080822143802.GA7271@frubble.xen.chris-lamb.co.uk
Whole thread Raw
In response to SERIAL datatype  (Peter Billen <peter@clueless.be>)
List pgsql-general
On Thu, Aug 21, 2008 at 09:08:24PM +0200, Peter Billen wrote:
> Is it possible to insert a new entry? Will the serial sequence somehow
> be able to find the gap (3)?

As others have said, no it's not going to.  Sequences will only return
values out of order when explicitly told to.  The main reason is to
help prevent ambiguities in the data; if it could automatically reset
it would be much more difficult to determine if 7 was "older" than 3
or, worse, which 7 is the correct one.  In a well designed system this
shouldn't ever occur, but if something does go horribly wrong it's much
easier to put the pieces back together this way.


  Sam

pgsql-general by date:

Previous
From: Markus Mehrwald
Date:
Subject: Re: problem with foreign keys + data-only backup
Next
From: Tom Lane
Date:
Subject: Re: Postgresql 8.3 statistic stadistinct value dead wrong even with default_statistics_target=1000