Re: filling database - Mailing list pgsql-general

From Steve Crawford
Subject Re: filling database
Date
Msg-id 521B9BE3.9000609@pinpointresearch.com
Whole thread Raw
In response to Re: filling database  (sachin kotwal <kotsachin@gmail.com>)
List pgsql-general
On 08/23/2013 03:29 AM, sachin kotwal wrote:
create sample table with one or two rows then use following command to
populate data.

INSERT INTO TABLE_NAME VALUES(generate_series(1,1000000000));

Cartesian joins are also useful - especially when you want semi-realistic data. A quick Google will get you a list of 1000 surnames and another 1000 given names. Then a cartesian join like:

select given.givenname, surnames.surname from given,surnames

will give you a million rows. Add a middle-initial column and you quickly expand to 26-million unique names. Need more? There are lists that go well beyond 1000 names or you can just use a full middle name instead of an initial and get a 1,000,000,000 names (or somewhat less if you eliminate names where first/middle/last name are the same).

Then you can chuckle at your newly integrated society with Huang Alexopoulos O'Leary, Albrecht Fernandez Grebenshchikov and Wekesa Étienne Nikoleta.

Add in similar lists of common town-names and street-names along with some generated street numbers and you will quickly exceed the world population and/or your storage capacity.

Cheers,
Steve



pgsql-general by date:

Previous
From: Rafael Martinez Guerrero
Date:
Subject: Re: Problem creating index
Next
From: Jeff Janes
Date:
Subject: Re: Problem creating index