Re: going crazy with serial type

Поиск
Список
Период
Сортировка
Искать
От
Stephan Szabo
Тема
Re: going crazy with serial type
Дата
Msg-id
20020131124743.G16906-100000@megazone23.bigpanda.com
Ответ на
Список
Дерево обсуждения
going crazy with serial type Cindy <ctmoore@uci.edu>
Re: going crazy with serial type Jason Earl <jason.earl@simplot.com>
Re: going crazy with serial type Stephan Szabo <sszabo@megazone23.bigpanda.com>
Re: going crazy with serial type Tom Lane <tgl@sss.pgh.pa.us>
Re: going crazy with serial type Stephan Szabo <sszabo@megazone23.bigpanda.com>
Re: going crazy with serial type mordicus <mordicus@free.fr>
Re: going crazy with serial type Cindy <ctmoore@uci.edu>
Re: going crazy with serial type Stephan Szabo <sszabo@megazone23.bigpanda.com>
Re: going crazy with serial type Tom Lane <tgl@sss.pgh.pa.us>
Re: going crazy with serial type Darren Ferguson <darren@crystalballinc.com>
Re: going crazy with serial type Jan Wieck <janwieck@yahoo.com>
Re: going crazy with serial type Tom Lane <tgl@sss.pgh.pa.us>
Re: going crazy with serial type Darren Ferguson <darren@crystalballinc.com>

On Thu, 31 Jan 2002, Tom Lane wrote:

> Stephan Szabo  writes:
> > You won't get that.  serial (and sequences) are guaranteed to give numbers
> > that haven't shown up in the sequence (note: you can still get duplicates
> > if you set values yourself, you can get around this with triggers -
>
> The SERIAL type implicitly adds a UNIQUE index, so you don't need to
> worry about uniqueness even if you sometimes manually insert values.

Right, but you get the intermittent errors in that case since the serial
doesn't skip the values that would error (which you might expect if you're
guaranteeing distinct numbers in a column).  When looked at as what it is
(an integer with a default) it makes sense, but if you don't know that
it's a bit unexpected.


В списке pgsql-general по дате отправления
От: Jason Earl
Дата:
От: Gregory Wood
Дата:
FAQ