| От | chester c young |
|---|---|
| Тема | Re: numbering rows on import from file |
| Дата | |
| Msg-id | 369040.10710.qm@web54307.mail.re2.yahoo.com обсуждение исходный текст |
| Ответ на | numbering rows on import from file (Alexy Khrabrov <deliverable@gmail.com>) |
| Список | pgsql-sql |
--- Alexy Khrabrov <deliverable@gmail.com> wrote:
> Now I want to number the rows, adding an id column
> as an autoincrement from a sequence. How should I do the import now
> for the sequence to work -- should I add the id column last, so it
> will not be filled by copy and presumably autoincrement?
use a sequence
restart sequence to 1 before copy
have column id default to nextval('seq')
when doing copy don't have a column matching your id (duh)
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера