| От | Vlad K. |
|---|---|
| Тема | Re: Copy rows, remember old and new pkey |
| Дата | |
| Msg-id | 50B3CBF7.2070004@haronmedia.com обсуждение исходный текст |
| Ответ на | Re: Copy rows, remember old and new pkey (Merlin Moncure <mmoncure@gmail.com>) |
| Список | pgsql-general |
On 11/26/2012 07:15 PM, Merlin Moncure wrote: > I don't think you need a CTE or a loop unless you want to delete the > old rows. Why not (hard to say exactly how it will work): > INSERT INTO a(old_id, new_id, ...) > SELECT id, new_id(), ... > from a; > ? Well, the table A, in which I'm copying rows, does not have old_id, new_id, just a primary key, so the idea is to link original pkey and new pkey separately. Adding new_id to the table is not an option, besides what would new_id() stand for? But thanks for the suggestion. -- .oO V Oo. Work Hard, Increase Production, Prevent Accidents, and Be Happy! ;)
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера