Re: Creating blank records with sequential record numbers

Поиск
Список
Период
Сортировка
От 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 по дате отправления:

Предыдущее
От: "Scott Marlowe"
Дата:
Сообщение: Re: Slow after VACUUM, fast after DROP-CREATE INDEX
Следующее
От: "Scott Marlowe"
Дата:
Сообщение: Re: Data version idea (please discuss)