Creating blank records with sequential record numbers

From: o(dot)blomqvist(at)secomintl(dot)com (Otto Blomqvist)
To: pgsql-general(at)postgresql(dot)org
Subject: Creating blank records with sequential record numbers
Date: 2004-08-05 18:55:26
Message-ID: c501cb7d.0408051055.6ab113cd@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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 ?

Thanks

/Otto Blomqvist

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Geoff Caplan 2004-08-05 19:10:51 Re: Correct escaping of untrusted data
Previous Message Richard Huxton 2004-08-05 18:39:45 Re: most idiomatic way to "update or insert"?