create table as select... with auto increment id ?

Поиск
Список
Период
Сортировка
От David Salisbury
Тема create table as select... with auto increment id ?
Дата
Msg-id 4E2E0799.6080002@globe.gov
обсуждение исходный текст
Ответы Re: create table as select... with auto increment id ?  (Peter Geoghegan <peter@2ndquadrant.com>)
Re: create table as select... with auto increment id ?  (Joe Conway <mail@joeconway.com>)
Список pgsql-general
We all know i can

create table freaky as select "abunchofstuff".

I work with rails developers and they are fussy about having an
auto incrementing "id" field.  Is there a way I can eak that out
of the above type statement, or am I stuck with creating the
table and no short cuts?

create table freaky ( id autoincrement, and-a-long-list int, and-perfect-order float )
insert into freaky as select "abunchofstuff-in-same-order"

I think I know the answer ;-<

Thanks for any info,

-Dave


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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: Tracing in Postgres
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: create table as select... with auto increment id ?