From: | "Scott Marlowe" <smarlowe(at)qwest(dot)net> |
---|---|
To: | "Otto Blomqvist" <o(dot)blomqvist(at)secomintl(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Creating blank records with sequential record numbers |
Date: | 2004-08-06 18:20:45 |
Message-ID: | 1091816445.27166.220.camel@localhost.localdomain |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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.
From | Date | Subject | |
---|---|---|---|
Next Message | Scott Marlowe | 2004-08-06 18:22:00 | Re: Data version idea (please discuss) |
Previous Message | Scott Marlowe | 2004-08-06 18:17:52 | Re: Slow after VACUUM, fast after DROP-CREATE INDEX |