| От | Wieger Uffink |
|---|---|
| Тема | Re: primary key generation |
| Дата | |
| Msg-id | 1008096314.1964.2.camel@barcelona.usmedia.nep обсуждение |
| Ответ на | primary key generation ("Ned Matson" <ned@go.com>) |
| Список | pgsql-general |
Hi You need to create a sequence and set the default value of the primary key on the next value in the sequence. An easy way to do this is to define the primary key integer field as type SERIAL ( instead of integer) at time of table creation. Postgres will automaticly create the sequence it needs, and set the default value of the key to the proper value. HTH, Wieger On Mon, 2001-12-10 at 22:58, Ned Matson wrote: > Does postgres have any built-in methods for auto-generating unique integer > primary keys or is managing this task the responsibility of the user? > > Thanks in advance... > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster >
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера