| От | Derrick Betts |
|---|---|
| Тема | Re: resetting primary key after copy |
| Дата | |
| Msg-id | 028201c74ecf$b10378a0$0202a8c0@main обсуждение исходный текст |
| Ответ на | resetting primary key after copy (Don Guernsey <dononyx@yahoo.com>) |
| Список | pgsql-novice |
> does anyone know how to do this? I need to reset the primary key after I > copy a > bunch of data to postgres. The other option would be to start my tables > primary > key at a high number, like 3000000. Any Ideas? > > This may not be a very smart idea (depending on if you have foreign keys, or links to the primary key from other tables, etc.), but perhaps you can copy your table, then delete your primary key, then delete the primary key column, then add a new primary key column, then create a function that adds unique numbers to the new column, then add the primary key constraint back into your table. Lots of work, but if it is what you are looking for... Keep in mind, I'm a novice reading a NOVICE list. Derrick
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера