Re: SERIAL datatype

Поиск
Список
Период
Сортировка
От Sam Mason
Тема Re: SERIAL datatype
Дата
Msg-id 20080822143802.GA7271@frubble.xen.chris-lamb.co.uk
обсуждение исходный текст
Ответ на SERIAL datatype  (Peter Billen <peter@clueless.be>)
Список 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 по дате отправления:

Предыдущее
От: Markus Mehrwald
Дата:
Сообщение: Re: problem with foreign keys + data-only backup
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Postgresql 8.3 statistic stadistinct value dead wrong even with default_statistics_target=1000