Re: Creating blank records with sequential record numbers
В списке pgsql-general по дате отправления:
| От | Scott Marlowe |
|---|---|
| Тема | Re: Creating blank records with sequential record numbers |
| Дата | |
| Msg-id | 1091816445.27166.220.camel@localhost.localdomain обсуждение исходный текст |
| Ответ на | Creating blank records with sequential record numbers (o.blomqvist@secomintl.com (Otto Blomqvist)) |
| Список | pgsql-general |
On Thu, 2004-08-05 at 12:55, Otto Blomqvist wrote: > Hello! > > I'm pretty sure this is an easy thing to do but I cant still figure > out how. I have a table with about 20 columns, one column being the > record_number. I want to insert 100'000 new records with 1, 2, 3, 4 > ... 100'000 in the record_number field. All the other columns can be > left at nulls or whatever the default is. > > Right now I'm doing this using a "for" loop in my app. Not very fast > or smart > > Any better ideas ? As long as you're wrapping it all into one big transaction, you're fine using a for next loop. Sure, you could probably write a pl function to do it, but I can't see it being worth the development effort if you've already got a script doing it.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера