Re: Import id column then convert to SEQUENCE?
От | Shoaib Mir |
---|---|
Тема | Re: Import id column then convert to SEQUENCE? |
Дата | |
Msg-id | AANLkTi=zuCCrz-0p4xeTk-cjkiyXeb=UP2cErtGt8tMa@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Import id column then convert to SEQUENCE? (Shoaib Mir <shoaibmir@gmail.com>) |
Ответы |
Re: Import id column then convert to SEQUENCE?
|
Список | pgsql-general |
On Fri, Dec 10, 2010 at 2:53 PM, Shoaib Mir <shoaibmir@gmail.com> wrote:
I guess I misread it... use the following:
- Import all the data into say an integer column.
- Now create a sequence and give it a start value of where your import ended.
- Make the default value for the column using the new sequence.
--
Shoaib Mir
http://shoaibmir.wordpress.com/
On Fri, Dec 10, 2010 at 2:44 PM, gvim <gvimrc@gmail.com> wrote:I'm migrating a database from MySQL and need to keep the original `id` column (AUTO_INCREMENT) intact so my plan is to create an simple integer `id` column, import the data then convert the new `id` column to a SEQUENCE. Is this possible/the best solution? Maybe a migration utility would be better? Suggestions?
Try using SERIAL datatype.
I guess I misread it... use the following:
- Import all the data into say an integer column.
- Now create a sequence and give it a start value of where your import ended.
- Make the default value for the column using the new sequence.
--
Shoaib Mir
http://shoaibmir.wordpress.com/
В списке pgsql-general по дате отправления: