Re: autoincrement question
От | Greg Cocks |
---|---|
Тема | Re: autoincrement question |
Дата | |
Msg-id | 66F6CF82BF58CE4DB4285BE816B297E83BABE2@tribble.SMStoller.com обсуждение исходный текст |
Ответ на | Re: autoincrement question (Richard Broersma Jr <rabroersma@yahoo.com>) |
Список | pgsql-novice |
-------------------------------- -----Original Message----- From: Richard Broersma Jr [mailto:rabroersma@yahoo.com] Sent: Monday, January 07, 2008 3:40 PM To: Jack Albright; Sean Davis Cc: pgsql-novice@postgresql.org Subject: Re: [NOVICE] autoincrement question --- On Mon, 1/7/08, Sean Davis <sdavis2@mail.nih.gov> wrote: > create table junktable ( > pk1 serial primary key > ); > > will get you what you want. Check out the docs for the > "serial" column type. |Also, if the table and column already exist, you can alter the table's |column to become an auto-incrementing column. |http://www.postgresql.org/docs/8.3/static/datatype-numeric.html#DATATYP E-|SERIAL |You can substitute the create table statement with an appropriate alter |table alter column statement from the example demonstrated in the above |link. If you are using an existing field with existing (unique) values, make sure that you (re)set the SERIAL's index to the next value that you want to use...
В списке pgsql-novice по дате отправления: