Re: Auto-incrementing field

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Auto-incrementing field
Дата
Msg-id 20020729143443.GA20033@wolff.to
обсуждение исходный текст
Ответ на Auto-incrementing field  ("Jim Steil" <jim.steil@customcall.com>)
Список pgsql-novice
On Fri, Jul 26, 2002 at 14:49:30 -0500,
  Jim Steil <jim.steil@customcall.com> wrote:
> Is there a data type in PostgreSQL that will 'auto-increment'?  I have used
> this in MS SQL Server in the past and would like to continue to do so with
> PostgreSQL.  Thanks for any help...

You probably want to use sequences. There is even a psuedo type "serial"
that makes using them easier.
Note that sequences provide unique values, but they can skip over values.
Normally this is OK for keys, but if you really want a counter then
you need to do something different.

В списке pgsql-novice по дате отправления:

Предыдущее
От: Wim
Дата:
Сообщение: Still problems with pg_dump ad \dt...
Следующее
От: "Jillian Carroll"
Дата:
Сообщение: Altering psqlodbc.h