Re: autoincrement question

Поиск
Список
Период
Сортировка
От Richard Broersma Jr
Тема Re: autoincrement question
Дата
Msg-id 305351.87756.qm@web31808.mail.mud.yahoo.com
обсуждение исходный текст
Ответ на Re: autoincrement question  ("Sean Davis" <sdavis2@mail.nih.gov>)
Ответы Re: autoincrement question  ("Greg Cocks" <gcocks@stoller.com>)
Список pgsql-novice
--- 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#DATATYPE-SERIAL

You can substitute the create table statement with an appropriate alter table alter column statement from the example
demonstratedin the above link. 

Regards,
Richard Broersma Jr.

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

Предыдущее
От: "Sean Davis"
Дата:
Сообщение: Re: autoincrement question
Следующее
От: "Greg Cocks"
Дата:
Сообщение: Re: autoincrement question